Introduce a service to represent wfReadOnly() and friends.
It's necessary to have two service instances, one for wfReadOnly() and
one for wfConfiguredReadOnlyReason(), to avoid a circular dependency,
since LoadBalancer needs the configured reason during construction, but
wfReadOnly() needs to query the currently active load balancer.
Not having a cache of the configuration makes it possible to dynamically
change the configuration. Ideally things would not change the
configuration, and I removed such instances in core, but to support
extensions, I added a test ensuring that the configuration can be changed.
Change-Id: I9bbee946c10742526d3423208efd68cb3cc5a7ee
ApiSetNotificationTimestamp expects to be able to clear the timestamp by
passing null. Allow that to work as expected.
Bug: T153482
Change-Id: Ibf4ba56f0abd3b72283f7a33e4665d5999a70b82
This way, when submitting POST to action=watch, the response will
not show "Unwatched" in the navigation 'content action' tabs.
This was previously the case on any wiki installation that has
more than 1 database as the skin would call User::isWatched(),
which would query stale data from a slave.
This doesn't yet account for the reverse use case (removing from
watchlist). That's to be addressed in a later commit.
Bug: T28292
Change-Id: Ie4b69c985815a77b70692db0c4dbf52e1a6a018d
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.
The old constant is an alias now.
Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
* Do not commit() inside masterPosWait(). This could happen
inside JobRunner::commitMasterChanges, resulting in
one DB committing while the others may or may not later commit.
* Migrate some commit() callers to commitMasterChanges().
* Removed unsafe upload class commit() which could break
outer transactions.
* Also cleaned up the "flush" flag to make it harder to misuse.
Change-Id: I75193baaed979100c5338abe0c0899abba3444cb
* This puts the complex logic here after the commit step for
all DBs, making the main multi-DB transaction more likely
to be atomic.
* Also fixed the reuseConnection() call by getting a new
handle in the callback.
Change-Id: I449a521423ff13bfbf49bdaa6e7e6df2145c8751
The new primary key is not usable in production (T130067), so batch the
query using the old where condition.
Some code ideas from I3dbe1de4cf39499728a2077a71157d4bcc203e44
Bug: T134613
Change-Id: Ic12926a5166f7578a1136c7944d883c2fe1f3b3a
Every single caller of Title::newFromLinkTarget() already special cases
when the LinkTarget object is already a Title, so move that logic into
one function.
Change-Id: Iba5432ae01c87850e5b34893092427c5b1629188
In order to cleanly revert "Allow reset of global services"
which breaks login.
This reverts commit 99e8d45b50.
Change-Id: Iae7f7b7b7083345dd50c313ee68e2e814f130f1a
I have left the phpdocs in NullStatsdDataFactory
to clearly show the return types of the interface
implemented.
Change-Id: I96cb64b4af16fc087028269a53d539f8c132f81c
Adding batches of watched items per users
makes much more sense.
Only the deprecated static WatchedItem method
needed the old silly way of passing in objects.
Change-Id: I90f9583b66bd3b5afcf07faefedb38a8a0149f6e
'1' for example will always result in a php array
key of int 1.
Same for all strings that look like / can correctly
be cast to ints
Change-Id: Id52e4273c6b2f342a148181ce63300aac37582d9
This method is also no used in SpecialEditWatchlist
Unit and Integration tests have also been added.
Bug: T129481
Change-Id: Ica136b6fee63be8de4c2fe502288dd2318d99114
Adds a method for getting watchlist's notification timestamps
for a batch of LinkTargets.
Bug: T129482
Change-Id: I1f84212e7879a84b34bb3b53859069fcea282bba
This is for batch counting of visiting watchers, following the change
made in I2868c31fc09121de381d822e8f49194e3022bb42.
Query/logic has been extracted from ApiQueryInfo.
Bug: T129482
Change-Id: Ia9a534f5edb7af3cb7bf86be358dddb5d8c259cf
This method counts the number of individual items
that a user is watching.
A subject and corresponding talk page would mean a
count of 2
Unit and integration tests are also added here
Bug: T129481
Change-Id: I4b55318dc1d1c5abab1c5da16cebf1a43ddf9248
Prior to this change in tests the overridden store
would remain in the instance static and thus could
be used in other places.
This patch introduces the used of ScopedCallbacks
in the override methods in WatchedItemStore.
This means that any instance of WatchedItemStore
should return to a regular state after each test.
This is better than requiring the tests to reset
the value back to the origional as this would likely
be forgotten and result in long hunts for failing
tests.
This was found while writing more tests...
Change-Id: I9aa71425642174ae9ea2c6d4f85dcd07d724af11
This query / logic has been extracted from
ApiQueryUserInfo.
Unit & Integration tests have also been added.
Relating to the task linked this is the last change
needed in this ApiQueryUserInfo!
Bug: T129482
Change-Id: I91aa109416c16cd1f257c9de46669e35d6fd34d7
When the notification timestamp for a LinkTarget is
updated all items relating to that LinkTarget should
be uncached!..
This also switches this class from a BagOStuff to
a HashBagOStuff as this cache index is only maintained
per process..
Change-Id: I5dc58e018a6a4a15903abc1e0b326b4220abc75e
This also removes assumptions that when a page
in one Namespace should be watched / removed
that the page in the talk / subject ns for the
page should have the same action applied
This should maintain all backward compatability
for the WatchedItem class
This also includes tests written by:
- WMDE-leszek
- Addshore
Bug: T127956
Change-Id: Iad9abafe4417bb479151a3bfbee6e1c78a3afe3c
This removes static logic from WatchedItem into a
class that we can slowly fill with watchlist database
and storage things.
This also removes the dual namespace handling in
the new implementation.
Change-Id: Ia67ab1d200ac393c65013b2091e61acefcb3defb