Revision slider disconnects wikEdDiff
Closed, ResolvedPublic5 Story Points

Description

Hello.

  1. Turn off wikEd if you have it.
  2. Turn on wikEdDiff if you do not have it.
  3. Open some versions diff.
  4. Observe the triangle.
  5. Slide.
  6. Behold the no triangle.
  7. Refresh.
  8. Be surprised.

Thank you.

Restricted Application added a project: TCB-Team. · View Herald TranscriptAug 17 2016, 10:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Reason behind the issue might be the same as in case of T142636. We will be looking into that.

Addshore moved this task from Incoming to Revision Slider on the TCB-Team board.Aug 19 2016, 10:23 AM
WMDE-leszek triaged this task as Normal priority.Aug 25 2016, 1:07 PM
Tobi_WMDE_SW set the point value for this task to 5.Aug 29 2016, 1:10 PM
Tobi_WMDE_SW moved this task from Proposed to Backlog on the TCB-Team-Sprint-2016-08-29 board.
Lea_WMDE raised the priority of this task from Normal to High.Aug 29 2016, 3:59 PM
Lea_WMDE moved this task from Incoming to Doing on the Revision-Slider board.Aug 29 2016, 4:13 PM

So I had a rather brief look at this and it seems that a way to solve a problem would be to have the gadget listen to a hook that revision slider triggers when loading a diff for a new pair of revisions, i.e. the way we took in T142636.

I'd suggest that we first have code related to Thanks issue merged, and then we could approach the author of wikEdDiff.js to figure out what would be the best way to adjust the gadget to use the hook. My quick code added to test if it is going to work at all is definitely not the best what we could get.

Wow, @WMDE-leszek, are you sure you haven't something better? Because wikEdDiff has a lot of private copies in a lot of wikies, you can't update all of them.

Change 308706 had a related patch set uploaded (by WMDE-leszek):
Add temporary code to re-add WikEdDiff gadget after reloading a diff

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

Change 308706 merged by jenkins-bot:
Add temporary code to re-add WikEdDiff gadget after reloading a diff

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

Change 308766 had a related patch set uploaded (by Addshore):
Add temporary code to re-add WikEdDiff gadget after reloading a diff

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

Change 308766 merged by jenkins-bot:
Add temporary code to re-add WikEdDiff gadget after reloading a diff

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

Although there is a quickfix implemented already, this ticket will only be closed, once the more sustainable solution is brought in position

Guycn2 removed a subscriber: Guycn2.Sep 12 2016, 6:53 PM
Addshore added a comment.EditedSep 13 2016, 8:16 AM

So I have identified a smallish list of places where I highly suspect the gadget needs to be fixed:

addshore@terbium:~$ mwgrep --user --max-results 200 "wikEd.DiffSetup"
## Public wiki results
cawiki              User:Mcapdevila/Articles/script1.js
dewiki              User:Trigonomie/wikEdDiff.js
enwiki              User:Cacycle/wikEdDiff.js
enwiki              User:K1mm3/monobook.js
enwiki              User:PrimeHunter/wikEdDiff 0.9.17.js
enwikisource        User:Cooljeanius/monobook.js
frwiki              User:Alt0160/wikEdDiff.js
frwiki              User:Hunsu/WikEd.js
frwiki              User:Irønie/diff2.js
idwiki              User:Riemogerz/media/script/wiked.user.js
newiki              User:Bhawani Gautam/wikEdDiff.js

(total: 11, shown: 11)
addshore@terbium:~$ mwgrep --user --max-results 200 "create wikEdDiff elements"
## Public wiki results
cawiki              User:Mcapdevila/Articles/script1.js
dewiki              User:Bisato/monobook.js
dewiki              User:Howwi/Greasemonkey/wiked.user.js
dewiki              User:ISBN/wikEdDiff.js
dewiki              User:ParaDoxa/Greasemonkey/wiked.user.js
dewiki              User:Trigonomie/wikEdDiff.js
elwiki              User:DemetrisKaragiannis/wikEd.js
enwiki              User:Cacycle/wikEdDiff dev.js
enwiki              User:Cacycle/wikEdDiff.js
enwiki              User:ISBN/wikEdDiff.js
enwiki              User:K1mm3/monobook.js
enwiki              User:Marci1994/monobook.js
enwiki              User:PrimeHunter/wikEdDiff 0.9.17.js
enwiki              User:Smith609/monobook.js
enwikisource        User:Cooljeanius/monobook.js
eswiki              User:TwinkleUser/diffs.js
eswikinews          User:Dreitmen/diffs.js
fawiki              User:Pesar amol/wikEdDiff.js
fawiki              User:Surena/wikEdDiff.js
fawikiquote         User:Mehdi/wikEdDiff.js
fiwiki              User:Zache/WikEdDiff.js
frwiki              User:Alt0160/wikEdDiff.js
frwiki              User:Hunsu/WikEd.js
frwiki              User:Irønie/diff2.js
idwiki              User:Riemogerz/media/script/wiked.user.js
mznwiki             User:پسر آمل/wikEdDiff.js
newiki              User:Bhawani Gautam/wikEdDiff.js
svwiki              User:Boldie/wikEd.user.js

(total: 28, shown: 28)

This list is small enough that we can send each user a message showing them the code that needs to be fixed.
We can then leave our 'hack' in place and perhaps add a console message to it too informing users that may look at the JS console to fix things.

IMO it may actually be better to deploy our code without the 'hack' for wikEdDiff and just get people to update their copy of the code asap.

As with our 'hack' in the RevisionSlider the wikeddiff code should basically do the following:

		reInitWikEdDiff: function () {
			$( 'meta[name=wikEdDiffSetupFlag]' ).remove();
			$( 'meta[name=wikEdDiffStartupFlag]' ).remove();
			wikEd.DiffSetup();
		},

Using the hook & code

	mw.hook( 'wikipage.diff' ).add( function ( $content ) {
			$( 'meta[name=wikEdDiffSetupFlag]' ).remove();
			$( 'meta[name=wikEdDiffStartupFlag]' ).remove();
			wikEd.DiffSetup();
	} );

I have created a MassMessage list for the users @ https://meta.wikimedia.org/wiki/User:Addshore/sandbox

Permalink https://meta.wikimedia.org/w/index.php?title=User:Addshore/sandbox&oldid=15905641

I have sent a message to the 26 users in the lists above.

The RevisionSlider will be deployed with the current in code 'hack' today.
This 'hack' will be removed in next weeks deployment at which point the RevisionSlider will start calling the wikipage.diff hook.

You just prooved my claim, @Addshore. You search did not catch our wiki code.

You just prooved my claim, @Addshore. You search did not catch our wiki code.

Can you provide me a link to your code?
If I have more ways of matching I can send out more messages :)

I think if you'll expand the search as I'll explain, you'll very encrease the chance to find them all. You can:

  1. Add mediawiki namespace.
  2. Add project namespace.
  3. Add pages with name wikeddiff with any capitalisation.
  4. And even with name wikieddiff, also it is misspelled.

I meant names with asterisks, as *wikeddiff*.

  1. mediawiki namespace with the two queries I used above lead me to find https://ko.wikiquote.org/w/index.php?title=%EB%AF%B8%EB%94%94%EC%96%B4%EC%9C%84%ED%82%A4%ED%86%A0%EB%A1%A0:Gadget-wikiEdDiff.js&oldid=26266 and only this.
  2. The project namespace with the same two queries returned nothing

I'm trying to only target the people with the source in their user space / pages that hold the source, so simply greping for 'wikeddiff' is probably not the best way forward as it will match much more than this, such as every user including the code from a page called wikeddiff.

Can you provide me a link to your code so that I can see what differs between that copy and the main copy and hopefully find some more things to match?

That's exactly the problem. I believe, when you don't, that anyone who maintains this code should be informed, not just that have this code, but also calles it. For example, if you have some User X in your first search, that is informed but is not a part of Wikipedia for years, he doesn't care and will not fix. But there can be a lot of people that just call to his code.
Other option for you, I think, is waiting a week or two and than you'll fix all the results that were not fixed yet by yourself.
This is our link and it uses one of those you found.

Ahh yes, User:Cacycle/wikEdDiff.js on enwiki is the main source and we will ensure that is fixed before our 'hack' is undeployed.

The deployment date might have altered slightly, but we will not know until next week.
I'll try to keep this ticket updated.

Alert: All the problems of Revisions Slider are back. @Lea_WMDE , @Addshore

@IKhitron what exactly do you mean?

WikEdDiff does not work again, Special:Thanks is opened in a new page again, and so on, @Lea_WMDE.

@IKhitron on what site? with what version of wikeddiff?

IKhitron added a comment.EditedSep 30 2016, 7:02 PM

Hewiki, here, @Addshore.

@IKhitron I just went to hewiki and enabled the gadget and both thanks and the gadget work as expected!
Can you try clearing your browser cache? for some reason you may still have some old JS cached.

Done, @Addshore, does not help. But I can see it's worse than month ago - wikEdDiff does not work even before RS opening.

@IKhitron I honestly don't know, as it is all working for me.
I only have the wikeddiff gadget enabled though, and no other user JS or other gadgets, perhaps one of them is interfering?
No code changes have been deployed in the last week.

@IKhitron is this still happening for you?

Yes, @Addshore. But I removed the RS for 5 minutes, and the problem stays. I think so it's the hook, not RS.

Tobi_WMDE_SW moved this task from Doing to Done on the Revision-Slider board.Oct 18 2016, 10:42 AM

Yes, @Addshore. But I removed the RS for 5 minutes, and the problem stays. I think so it's the hook, not RS.

I still don't quite follow.
If you are not using the slider then the page will not be reloaded with AJAX!
Closing for now as if this is happening while you have RS disabled it is likely not related to RS.

Addshore closed this task as Resolved.Oct 19 2016, 2:14 PM
Addshore added a project: User-Addshore.
Addshore moved this task from Backlog to Done / Closed on the User-Addshore board.

I thinik. @Addshore, it happens because of bad code change in wikEdDiff for your hook.

I thinik. @Addshore, it happens because of bad code change in wikEdDiff for your hook.

But then it would also be happening for me & others!

Yes, if some configuration does not disturb, @Addshore.
Even to me, it sometimes work and sometimes doesn't, so the problem should be in synchronisation.

IKhitron added a subscriber: Kipod.Nov 30 2016, 1:38 PM

Well, @Addshore, It's OK now, I think. At least I tryed many times and it works. Thanks to @Kipod that fixed it in our wiki.