Page MenuHomePhabricator

Special:ManageTranslatorSandbox fails to finish loading
Closed, ResolvedPublic

Description

I opened https://translatewiki.net/wiki/Special:ManageTranslatorSandbox and the right hand side was blank (no buttons to approve/reject users). Moreover, clicking any of the items in the queue did not do anything.

After (hard) refreshing, the page was loaded correctly.

Details

Related Gerrit Patches:
mediawiki/extensions/Translate : masterMove document-ready to the bottom

Event Timeline

Nemo_bis created this task.Sep 10 2015, 7:13 AM
Nemo_bis raised the priority of this task from to Needs Triage.
Nemo_bis updated the task description. (Show Details)
Nemo_bis added a subscriber: Nemo_bis.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 10 2015, 7:13 AM

Hard to debug and fix these non-reproducible issues.

Indeed. Maybe the ResourceLoader folks can write some docs on how to identify and fix FOUC, graphical glitches and load failures happening after the recent changes?

Nemo_bis added a comment.EditedSep 25 2015, 7:34 AM

Today I opened https://translatewiki.net/wiki/Special:ManageTranslatorSandbox again for the first time in a while and it stalled for a long time (probably a minute) in "read translatewiki.net...", then it loaded correctly (or it looked like it did; didn't click anything).

However, when I did ctrl-f5, the page reloaded with the same issue originally reported (and relatively quickier; probably less than 15 seconds). No JavaScript errors in the console.

Could this be related to T111685?

Could this be related to T111685?

Sure, T112047 was already mentioned there.

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptNov 3 2015, 5:22 PM

That's the list of the main suspects, yes. AFAIK we're still waiting for documentation on how special page and extension developers can make sure things are loaded in correct sequence.

TheDJ added a subscriber: TheDJ.Nov 30 2015, 9:07 AM

"no buttons" sounds like an execution error... But I have no access to that page, anyone else have an easy test route for this ?

"no buttons" sounds like an execution error... But I have no access to that page, anyone else have an easy test route for this ?

Try https://dev.translatewiki.net/wiki/Special:ManageTranslatorSandbox , I gave you permissions there.

JS execution error:

[Error] TypeError: $('.request-filter-box').translatorSearch is not a function. (In '$('.request-filter-box').translatorSearch()', '$('.request-filter-box').translatorSearch' is undefined)
	log
	handler
	fire
	fireWith
	fire
	track
	runScript
	checkCssHandles
	(anonymous function)
	fire
	fireWith
	fire
	fireCallbacks
	addEmbeddedCSS
	(anonymous function)
TheDJ added a comment.Nov 30 2015, 1:22 PM

The problem is that ext.translate.special.managetranslatorsandbox has a document.ready function that uses "translatorSearch()". This document.ready is immediately executed when the JS code is being executed, because the dom is already available. However $.fn.translatorSearch() is only defined several lines below this execution, and thus we see an undefined.

The document.ready's should be at the bottom of your scripts, or split it out into multiple modules with dependencies.

Nemo_bis triaged this task as Medium priority.Nov 30 2015, 3:40 PM

Oh thanks for spotting this.

Change 256178 had a related patch set uploaded (by Nikerabbit):
Move document-ready to the bottom

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

Change 256178 merged by jenkins-bot:
Move document-ready to the bottom

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

Nemo_bis closed this task as Resolved.Dec 1 2015, 12:10 PM

The document.ready's should be at the bottom of your scripts, or split it out into multiple modules with dependencies.

Can this be generalised into a general recommendation at [[CC/JS]] or some [[RL]] subpage?

TheDJ added a comment.Dec 1 2015, 12:47 PM

The document.ready's should be at the bottom of your scripts, or split it out into multiple modules with dependencies.

Can this be generalised into a general recommendation at [[CC/JS]] or some [[RL]] subpage?

Difficult. "define before you use" is already a recommendation for JS, but here the usage is somewhat hidden due to jQuery. You could argue that modules using a jquery collection should ideally be separate from modules publishing a jquery collection function...

Ok, I can't reproduce the bug any longer despite several attempts in Firefox 42 (though there is still a rather large FOUC: F3039910).