Page MenuHomePhabricator

Deployment of jquery.mwExtension being marked as deprecated crashes scripts
Closed, DeclinedPublic


Since deployment of rMWb0ee0c01c2ae230d24ef603e1eb07ca6bc529b8f with 1.26wmf11, any usage of these functions which are deprecated since today crashes.

It fails with Exception in load-callback in module jquery.mwExtension.

It is not possible to localize the error further, since it entirely breaks down when called with &debug=true and gives no response at all then.

The last message before dying is to tell something like Use of "trimRight" is deprecated. and the call stack of console.trace().

The error becomes effective around mw.trackSubscribe('resourceloader.exception',log) but this is not necessarily the cause itself.

Event Timeline

PerfektesChaos raised the priority of this task from to High.
PerfektesChaos updated the task description. (Show Details)
PerfektesChaos added a subscriber: PerfektesChaos.

The load-callback error should also have an exception property. What is the exception message?

The console trace, what does it show? Which code is calling trimRight and causing an exception? It sounds like maybe a script is giving an invalid value that cannot be trimmed. In that case the exception is not new and the gadget was already broken but the deprecation warning made it easier to find the problem.

Is there a particular page or wiki where this happens?

What browser and version thereof are you using?

Does it happen when you're logged-out? If not, try disabling individual gadgets and see which one is causing it.

In what way does the script "crash". Are there other warnings or errors in the console? Do other scripts still work? E.g. when you type in the search input field, do you get suggestions?

  • It doesn't tell me anything more than I described. The missing exception message might be the problem itself or a clue.
  • dewiki and enwiki
  • Not longer; I made a quick migration since it has been a crucial tool for editing.
  • FF 38.0.5
  • When I am not logged in, none of these scripts were activated.
  • I tracked it down until a console.log() just before e.g. a $.trimRight() and one just one line afterwards. It did not recover, nor anything else in the same thread/package/load.
  • The very last message was Exception in load-callback in module jquery.mwExtension: terminated by colon, and gone.
  • Suggestions were not affected, but slow the last days anyway.
  • I tried to solve the problem by deleting localStorage to avoid interaction with wmf11 shift today, but had no effect. Browser cache cleared for the same reason.

At least Page-Previews uses $.escapeRE very often an shows thousands of deprecation messages in the JavaScript console (T103610). I created to change this in Hovercards.

I missed to answer

It sounds like maybe a script is giving an invalid value that cannot be trimmed.

No, it was a regular string; it has been recorded as expected the line before by console.log(). Actually it did not need any trimming under those conditions. BTW, one line before reads as

if ( typeof say === 'string' ) {

I have replaced the business everywhere by plain say.replace( /\s+$/, '' ) now, which works fine again. If by any circumstance the argument wouldn't be a string, that would fail also.

The trace showed only a few entries yesterday, which I forgot. Today it has regular length

Apparently something happened somewhere. While the problem persisted over two hours yesterday evening, this morning I could not reproduce it any longer. I did not change anything, pretty sure not sleepwalking nor sleepcoding.

Perhaps a server cache update problem; resources/src/mediawiki/mediawiki.js itself is not affected by its own versioning mechanism and might have been delivered in wmf10 state but supposed to be already wmf11 by recent upgrades.

Unrelated references of recent deprecations: T103610, T103498.

Note: The module has been requested explicitly before any usage together with all other probably needed resources. It would have been simply an unknown function otherwise.

Some other gadgets and scripts were relying on automatic loading in mediawiki.util.js before and broke now.

Krinkle claimed this task.

I'll attribute this to the console.trace() overhead for now, which is resolved as of 8dbab8945c6ef6967879.

If someone still runs it into this, please re-open.