Last modified: 2014-08-04 13:47:52 UTC
We get "Unknown error" (not internationalised) when saving on officewiki. This is because the response object given to ve.init.mw.Target.onSave is actually a jqXhr(?) object here for some reason, which has an error function. The data we actually want is in the responseJSON property of this, and we can also get it via .done( ... ). This stuff comes through tryWithPreparedCacheKey and the way it fits together with everything else wasn't very clear here (lots of chaining deferreds etc.)
Does not affect other private wikis (checked otrswiki, collabwiki), not major/high priority.
officewiki is important, actually
Change 148757 had a related patch set uploaded by Catrope: Followup b141a7d23: don't display:none; the popup in the DesktopContext https://gerrit.wikimedia.org/r/148757
Mis-fire.
This was caused by local JS overwriting Function.prototype.bind with a broken polyfill that ignores additional parameters rather than passing them to the bound function. We were using something like onSave.bind( this, doc, saveData ) which should have resulted in a call like onSave( doc, saveData, responseData, statusText, jqXHR ) but the broken polyfill dropped doc and saveData, causing the remaining arguments to be shifted two places to the left. Then when we check if responseData.error is defined, we're really looking at jqXHR.error, which is in fact a method on the jqXHR object, so it's always defined and we always believe there is an error, even if there isn't one. But of course we can't find an error code or error text because we're looking in the wrong place, so we say "Unknown error". In fact, we would say that even if there was an error, because the error data got shifted over into the doc parameter, which we don't look at. https://office.wikimedia.org/w/index.php?title=MediaWiki:LAPI.js&diff=115901&oldid=24064 fixes the unconditional overwrite so Function.prototype.bind isn't overwritten if it's already present. This check was already being done for everything else that the script polyfills. https://office.wikimedia.org/w/index.php?title=MediaWiki%3ALAPI.js&diff=115904&oldid=115902 fixes the polyfill to correctly pass additional parameters along.
https://dpaste.de/JS7k/raw courtesy of legoktm is an mwgrep of all of the redefinitions of bind on the cluster. Yay.
So that last srwikibooks entry appears to be in an unused file... Roan, can you release and upstream the LAPI.js changes to the other wikis? I don't think I can do it (I'd have to do it as staff, but my global editinterface is personal, so...).