The new trait provides conveniance methods for logging and throwing
errors based on StatusValue instances.
Change-Id: Id7cbacb744bee79cd8a6f61291a26b36e6243053
These two messages were recently changed to simplify
the example URL parameter.
This simplifies them further by making the sentence flow
more naturally.
Change-Id: Ib05e4f352d5a7f6dc68b720da9c2c987f968a819
Why
* ApiQueryWatchList allows filtering anon users or not-anon users.
It is not obvious wether temporary users should be considered
anon for these purposes.
* The equivalent filters in recent changes group temporary users
with anonymous users (T343322).
* Since ApiQueryWatchlist queries the recentchanges table, and
shares many filters with recent changes, it makes sense to
filter the same way in both, and therefore to group temporary
users with anonymous users.
What
* Update queries in WatchedItemQueryService to group temporary
users with anonymous users for FILTER_ANON and FILTER_NOT_ANON.
* Don't change the 'anon' flag, because the other APIs flag
temporary users with anon=false.
* Instead add a 'temp' flag for temporary users.
Bug: T358693
Change-Id: I4cd3a4d0c5f4f488933cf3f06dee62a9beb85440
Uploads can be a long operation that we would prefer not to get
cut off. The API upload module supports a variety of upload types.
This calls useTransactionalTimeLimit() for all of them (except
checkstatus which is not a write operations) however it is more
applicable to some methods than other methods such as "async" where
the real work happens in the job queue.
Change-Id: I6795f6d38693306f22091afa77123f2f0721ef5b
Why:
* The ApiQueryUserInfo API returns 'anon' as true when the user
making the request is an IP user.
* This API should return 'temp' if the user making the request is
a temporary account, as described by T358683.
What:
* Return 'temp' with the value true from the ApiQueryUserInfo API
when the user making the API request is a temporary user.
* Test that the temp user flag is added when the user making the
request is a temporary user and that the flag is not added when
the user is logged-out.
Bug: T358683
Change-Id: I5f165576a12a2218d89ab3623d7df45e2c9049fa
Why:
* The ApiQueryContributors API description says that it returns
'the list of logged-in contributors' for given pages in the API
summary text.
* When temporary accounts are enabled, this list will include both
named and temporary accounts. As such, the message needs to be
updated to make this clear for users of the API on a wiki which
has temporary accounts enabled.
What:
* Add 'apihelp-query+contributors-summary-tempusers-enabled'
which is shown instead of the existing summary message for the
API if TempUserConfig::isEnabled returns true.
* Update existing mention of 'anonymous' with 'logged-out' to
per https://w.wiki/9Ji$ in the existing summary message.
* Update the existing message documentation for the summary message
to link to this new message to make it easier for translators.
* Test the newly added PHP code.
Bug: T341228
Change-Id: Id1bd597e068cb3aa946c94686ca6fa39ef1df89f
These messages take in the localised model name as $2. It doesn't make
sense to put that within code tags.
Change-Id: I69a5ea43e4180e1d7933764edbdcebb5627b211c
Add blockedtext-tempuser and autoblockedtext-tempuser to
ApiBase::BLOCK_CODE_MAP and ApiMessageTrait::messageMap
Change-Id: Ia365a300b16ee1ebd39556bc138c183f39b464ed
The ChunkedUpload feature stores information about in progress uploads
in the uploadstash table. The AssembleUploadChunksJob reads this data
from the primary DB to prevent race conditions. However the job is
inserted into the job queue before the current transaction commits,
so the race is still present. The job sees the old version, and as
a result drops the final chunk, corrupting the file (Often noticable
by files that have a size which are a multiple of 5mb).
This changes the job push from ->push to ->lazyPush which will make
the job insert happen in a DeferredUpdate after the primary transaction
has commited. Additionally, pass the expected size to the job queue
and assert that UploadStash class has the same filesize as expected.
This will ensure that if this issue happens again, the upload will
abort and it will show up in the logs instead of silently corrupting
files.
Bug: T350917
Change-Id: I37c5c8ffc882026a9fab252b20a10cf4c43d48bc