It wasn't obvious to me that the mediawiki.org link actually pointed
to specific instructions for resolving the error, as opposed to
just telling the user to search on mediawiki.org. Try to make this
a bit more obvious.
Change-Id: Id9a6cf9ee2520db9d405e17eaf34b10bd72897f3
The new style of checking for the last error during a section of
calls is more robust since it allows nesting of callers. Typically,
an external caller will want to watch a section of code that will
involve zero or more internally watched sections. Errors that are
seen internally (leading to a failing response) should also be
visible externally.
Replace internal BagOStuff clearLastError() calls.
Replace WANObjectCache clearLastError() calls. Such a class should not
clear the error codes since the class is effectively "internal". Callers
that are more meaningfully "external" might want to check the errors.
Cleanup "last" error handling for proxy backends.
Change-Id: I281817a85602967c0ec2bdd23a5d8be101680b64
Slow fatal, before:
> DBTransactionSizeError:
> Transaction spent 3.016772747039795 second(s) in writes,
> exceeding the limit of 3
After:
> DBTransactionSizeError:
> Transaction spent 3.016s in writes, exceeding the 3s limit
Fast debug, before:
> [DBPerformance] Transaction spent 0.015979528427124 second(s) in
> writes, less than the limit of 3
After:
> [DBPerformance] Transaction spent 16ms in writes, under the 3s limit
Test plan:
* Set `$wgMaxUserDBWriteDuration = 3;` in LocalSettings.php.
* Perform a db-writing user action, such as an edit.
* Check mw debug log.
* Set `$wgMaxUserDBWriteDuration = 0.0001;` in LocalSettings.php,
and ensure `$wgShowExceptionDetails = true;` is set as well
(default if using official dev environments, or otherwise
including DevelopmentSettings.php, otherwise check exception log),
or add an artificial delay in DatabaseMysqli::doQuery().
* Perform a user action, and observe the fatal error.
Change-Id: Ice91ad25a836c4d9a824f9c0f6ec8debaad46adc
With a user-friendly error message which uses both technical and
non-technical language, without the irrelevant detail of filebackend
URLs.
Bug: T283045
Change-Id: I8704f405d38acdffae7bd4ea5b91f3f591fc2ebc
The shellouts to djvudump and djvutxt are combined with a wrapping shell
script, scripts/retrieveMetaData.sh so the djvu file only needs to be
transmitted to a Shellbox service once.
Windows users can change the new $wgDjvuShell setting to point to a
different shell.
Bug: T289228
Change-Id: Ic4e3dff246792692a952da0e8f9b4a83d1b6b963
* Replace `substr`/`substring` with `slice`. The second argument
to `substring` is length, not end index as in `substr`/`slice`,
so convert where necessary.
* Replace `new Date().getTime()` with `Date.now()`
* Documentation fixes
* Replace `throw Error` with `throw new Error`
Change-Id: I532500ea4c99d8ebec01efb21273c8df21626e59
The null check for the class property packageFiles needs change to
check the return value of the function instead, because Phan would
report an issue that a null value is used in the foreach.
Phan does not understand the relation between the return value and the
class property.
When using a local variable then Phan can check
that the value is never null when used.
Change-Id: I48ac8a8fe55ae7b4e13bc94d2f2d2ede01fbc68b
The property was set, but never read. Use it similar to
mHeaderVariant/mURLVariant and return the value when set.
Originally introduced without caching (r60961, 81f62b6f61) but had no
clear explanation. The unclear comment was removed in I62bd09d7d0.
Change-Id: I863d77618c7f26686ae4de76024878655f516e04
This reverts commit 2bcb3fe567.
Reason for revert: this is a good change,
just needed more work to not break CI
Change-Id: I23768bee242e3cf81b1493a740cf070e7ad1e224
The method is marked unstable, since it's not encouraged to override
this. The HTML construction should be moved to a template / hook based
system.
Also remove deprecated global $wg variable access in favor of injected
Config.
Bug: T295068
Change-Id: I93b559bbb1612608785cf5633e8973c45c421171
phan says that $this->mainCollator is not documented to get null
assigned.
Use a local variable to check for null and than set the class property.
Change-Id: I000c935da8d99184f2ae0382fc5caac81e80c8d7
Replace assert.(not)ok/(not)equal with strict equality checks:
assert.true/false/(not)strictEqual.
Will be enforced in upcoming eslint-config-wikimedia release.
Change-Id: I4a9523b72834524a4b4e4339d5b175a8346a646c
This does not move the actual limit report data into
ParserOptions yet, that should be done separately
given that it will require serialization changes.
Let's get this change settled first before messing
with serialization.
This unifies canonical and non-canonical ParserOptions,
so ParserCache can now be used with both. It is hard
to say how this will affect the ParserCache capacity,
so we should monitor it after releasing this.
Change-Id: I154c0a77a5b0287b5572614d56339fb57ac56c33