Page MenuHomePhabricator

Adding an implementation / tester to the list of connected implementations / testers that is already in the list should be a no-op
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
A new page opens with the single Implementation listed twice. The “Details” metadata is identical for both rows.
https://www.wikifunctions.org/w/index.php?title=Special:CreateObject&uselang=en&zid=Z20&Z20K1=Z13909

What should have happened instead?:
The new page should have listed the single Implementation just once,

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

IMG_0916.png (960×2,079 px, 668 KB)

IMG_0915.png (960×2,079 px, 202 KB)

Event Timeline

DSmit-WMF changed the task status from Open to In Progress.Jul 15 2024, 5:42 PM
DSmit-WMF claimed this task.

For some reason, two edits in quick succession added Z13911 twice to the Z8K4 on Z13909:

We can see that there are now two Z13909s in the Z8K4: https://www.wikifunctions.org/wiki/Z13909?action=raw

I clicked on "disconnect", which removed both, and then connected it again.
Disconnecting: https://www.wikifunctions.org/wiki/Z13909?uselang=en&diff=prev&oldid=114746
Connect: https://www.wikifunctions.org/wiki/Z13909?uselang=en&diff=prev&oldid=114747

That fixed the reported issue.

The underlying issue is that an already connected implementation shouldn't be added to the list of connected implementations. The PHP layer should just do nothing in that case (no error needs to bubble up I guess).

Renamed bug accordingly.

DVrandecic renamed this task from Duplicate Implementation rows when adding a Test case to Adding an implementation to the list of connected implementations that is already in the list should be a no-op.Jul 15 2024, 6:03 PM

The issue was also present on Z16053 and Z17506.

It also happens for tests. The following functions had duplicate tests: Z13163, Z13306, Z14573, Z14576, Z16919, and Z17506

For now, I fixed them all manually.

DVrandecic renamed this task from Adding an implementation to the list of connected implementations that is already in the list should be a no-op to Adding an implementation / tester to the list of connected implementations / testers that is already in the list should be a no-op.Jul 15 2024, 6:56 PM
DSmit-WMF subscribed.
DSmit-WMF changed the task status from In Progress to Open.Jul 16 2024, 12:31 PM

The issue is that when the api call is still loading, the button still stays enabled. meaning the user can click the button as many times as he wants to connect or disconnect a tester or implementation. this will fire multiple api calls in a row.

If we want to still change the backend to prevent this.

Nothing to prevent from the PHP layer.
In this case, the Vue app is fully responsible of building this content and saving it.
The PHP layer is okay with [ "Z14", "Z13911", "Z13911" ] as long as that's a valid ZObject (which it is), so this falls fully on the button state handling side.

Change #1192564 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] FunctionViewerDetailsTable: disable connect and disconnect buttons when loading

https://gerrit.wikimedia.org/r/1192564

Change #1192564 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] FunctionViewerDetailsTable: disable connect and disconnect buttons when loading

https://gerrit.wikimedia.org/r/1192564

Tested on wikifunctions.org and confirmed it works as expected