The code would repeatedly read primary, always getting
the same result. Let's avoid this and do the query
at most once.
Change-Id: I4c09b92cac5e4dc7fd8d36f9751be4f9149181cb
Replace User::getOption() with UserOptionsLookup::getOption() since this method will be hard-deprecated.
Bug: T296083
Change-Id: I0ecdc63b0344bc4c24196cc5edb3d02b6a7ed615
I believe this is a bug. Individual user's option ($userNotifyTypes)
should not influence the options for all users ($notifyTypes).
This piece of code was first introduced in
I51600bbb26594323831d22bc35d34587ff146d47.
Change-Id: I32d56891ac68e82734813280505b4a57d5427f8c
Adds AttributeManager to EchoServices so that dependencies of
AttributeManager can be injected.
Bug: T275148
Change-Id: I4fa5084d72914d16b6d218e7dd3521f5a1919b80
isRegistered is part of the slick UserIdentity interface, i.e.
it's the more "canonical" form. This change makes it a bit
easier to move away from using the huge (4000+ LOC) User class
everywhere, in favor of the UserIdentity interface, where
possible.
This patch is meant as a small step towards this goal. I tried
to replace some usages of User type hints already, but prefer
to go in small, incremental steps.
Change-Id: I039c7a18672dfb6ea9507752bce9ea754babd690
* EchoEvent now supports `extra` params for job delay and deduplication
* When Echo identifies this type of param it creates a
DelayedEchoNotificationJob that will be executed after `delay` seconds
Change-Id: Ib0c6789dfe42e9703a67835909e5932c0054089f
Adds statsd counters for events and notifications, both overall and by
type. (Events and notifications have a one-to-many relationship, as
notifications may be created for multiple users per event.)
These are specifically of interest to estimate the potential volume of
notifications to be handled by the new push service.
Bug: T260836
Change-Id: I41974cd30a90c674f56003e15d540a5581d19c7d
* Add a section on the preference form to allow users to mute articles
from generating "page linked" notices
* The preference will save the article title as an article ID
Depends-On: Ia0ddf78646ec4c8ae0b84b6d5b46ef5e51c8e8c1
Bug: T46787
Change-Id: I67f751eae5fdc5bccff7fe3047227d432c1cb8d5
PHP doesn't care much about the name (in terms of case sensitivity)
but I think we should make sure the names of the method should be as
they're in their definition.
Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
This codebase already used the …::class feature a lot. This is more
about making the code consistent and easier to refactor in the future.
Change-Id: If5b2456b825aae753ed97445160ec191c18df8e3
Specify which notification types allow notifying the event agent in
$wgEchoNotifications, and stop specifying it in the event_extra data.
Putting 'notifyAgent' => true in event_extra will still work, but is
discouraged.
Change-Id: I4f558654ec23757dd4ecd6986eb3e9a5593f5386
Some Echo events include 'revid' in their extra info.
It can be used to check if a revision is minor in order
to respect the 'enotifminoredits' preference.
This patch ensures that it is not trying to call a function on
a null revision reference and it logs to debug to help
troubleshooting.
Also encapsulate the "is minor" check to a private function
to (hopefully) make the relationship with the preference
more clear.
Bug: T204795
Change-Id: I28a4c54f610dccc1356f6af0de9c2623d7bf94f0
The `DBMasterPos` class is not JSON-serializable, so
we can not transfer the job in the kafka-based queue.
Before, we were waiting for slaves before executing the
job till the point in time when the job was submitted,
now we will just wait for slaves till the point in time
the job was executed. That lets up not to include the
database master position in the event and make it serializable.
Bug: T192945
Change-Id: I7c754bd1e899bad030cc6434be19daf2542e015f
As Krinkle points out, it always writes to DB_MASTER, so it doesn't make
much sense to offer an option to read from DB_REPLICA. This also
resolves the race condition that I believe arises from the one caller
that passes in DB_REPLICA.
Change-Id: I6976e5479debc3f4a8f28d53b1616c01475772be
We almost always call it with DB_MASTER, and I'm pretty sure that the
one call that uses DB_REPLICA introduces a race condition. I didn't want
to change that quite yet, though, so I left it in for now.
Change-Id: Ia5a59fdda357b799e327b8ed224f3ccb09509a8a
NotificationJob used to include an instance
of EchoEvent, which is not serializable.
With this change, it only includes the
event Id (int) and retrieve the event
instance in its run() function.
Bug: T192945
Change-Id: I00950ddfa37717c7dfc19efdca9701693622da5d
There was a null-dereference for events without titles.
Also, it should only whitelist their own user talk space, not e.g.
mentions on someone else's user talk space.
Bug: T150419
Bug: T166627
Change-Id: If7d9cad4eb33ce1f1e6b7d86244332ad5dece954