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
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Usage.ForbiddenFunctions.isset
* MediaWiki.Usage.PHPUnitDeprecatedMethods.AssertInternalTypeGeneric
Additional changes:
* Also sorted "composer fix" command to run phpcbf last.
Change-Id: I29416247ff3736799543926813beaf4afd569a6e
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
To my knowledge in all the places I'm touching in this patch the new
code is functionally identical to the old one.
Change-Id: I0ffa96d2f9cb9bf932f68b689244051c96c17ad9
Class Revision is deprecated and in this patch, replaces
usage with appropriate classes; RevisionRecord, RevisionStore,
etc.
Bug: T221163
Change-Id: Icfc85167a636bef95daab236ab80113c1a3cf41b
When pages are deleted or undeleted, their associated
Echo notifications also need to be marked as deleted
or undeleted. This is done by looking up the
echo_target_page table.
With this change, echo_event.event_page_id is also included
in the search. This way, all the events that don't use
target pages are also moderated when needed.
Bug: T217452
Change-Id: I277fca68ce088ab564e76ed9dfb2134ab3be4c4a
Also remove fetchNewestByUserBundleHash() because it's now unused,
and remove the echo_notification_user_hash_timestamp index which
existed specifically to support that function's DB query.
Bug: T143763
Change-Id: I74be8f156bc14d0e189d328953d17dc26cdb697b
No longer used in the new bundling system.
Also removes indexes that contain bundle_base.
Bug: T143763
Bug: T131415
Change-Id: Ibf94cdc471a11cb14995fee6a55af0d227b50aa5
By running updateEchoSchemaForSuppression.php as an updater.
The patch-*.sql files already existed, they were added
in 2013(!) by 34fbeaf8c but never applied.
Bug: T136427
Bug: T50059
Change-Id: Ied049681df4bab325f069c3a68cf704ee9a8f2c9
This fixes tests, because EchoHooks has "echo_event.*" which is invalid
with table prefixes, like done in unit tests
Added EchoEvent::selectFields() for future use and to replace more
SELECT *
Bug: T217487
Change-Id: I51cb46812431635d11780633dc7d807cd04f813d
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
This fixes some issues I found while updating this code base, e.g.
this removes types a method really does not return.
Change-Id: I19457e7bf88945eec958bf53e0b76a7585715a45
Most modern IDEs as well as documentation generators understand the
keywords "false" and "true", when a bool can only be one of the two.
Change-Id: I83dd1f0cc0802fa74ee35e7ca7425615230a767f
There are about 200 of such generic "array" type hints in this code base,
the majority in @param tags. I started with what I found most relevant:
@var and @return tags. I might continue working on this later, but
wanted to stop for now to keep this patch moderately small.
Change-Id: Iff0d9590a794ae0f885466ef6bb336b0b42a6cd3
This cache was only used so that, if we're told to clear the newtalk
flag and we already know there are no edit-user-talk notifications, we
won't try to delete them. But that's not a good justification for such a
confusingly-written cache that would have been hard to convert to
getWithSetCallback(), and I'm concerned that using cached data to make
this decision could lead to inconsistencies.
Also remove the notifCountHasReachedMax() check, which made no sense: if
the user has >99 notifications, that is no justification for not marking
their user talk notifications as read when they visit their user talk
page. Whether the displayed notification count will change has no
bearing on whether these notifications should be marked as read (and now
that bundled notifications are counted individually, the displayed count
actually could change).
Bug: T164860
Change-Id: I3ff5c9b31307839b9336bd8856015db9baa52fad
Add the ability to create notifications with specific timestamps
when generating notifications through the maintenance script.
Note, that not all notifications can be given specific timestamp;
only notifications that do not involve a direct editing action
will be given this timestamp and their events will be created
as if the actions were taken at the given timestamp, with
1 minute intervals.
Change-Id: I9e6b8660178ca0734979946c8e6ec8d43fc3de41
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
Doing it in two lines makes it easier to read
This makes also clear that this is not a broken condition
Change-Id: I9771b6457789b7dc572f2d73d1fae8c361f9a1e6
User objects haven't been stubbed in awhile, and language objects
aren't being stubbed anymore.
While we're here, swap a few MWException -> InvalidArgumentException
since they're more accurate :)
Change-Id: I7e2f2aa135b024fb653c3ec13181d7015383ff2f