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
When creating the various notification sources,
the server was indexing them with wfWikiID() but
the client was using wgDBname to find which one
is local and which are remote. On some wikis,
like TWN, wfWikiID() includes a db suffix so
the JS app on Special:Notifications is failing to
find the local source and errors.
Bug: T167336
Change-Id: Id60f723b615fb7db54a6f17b1c1be20dfe98e36c
When deleting echo_notification or echo_email_batch rows, also delete
the corresponding echo_event rows if no other echo_notification rows
or echo_email_batch rows refer to them.
Bug: T221262
Change-Id: I416ff107bd000a0cfac102408c993f8bec2d0286
$wgEchoSectionTransition was introduced when we moved some notification
types between sections (alert, message).
$wgEchoBundleTransition was introduced when we made bundles dynamic
and expandable.
Both flags have been OFF for years and are not needed anymore.
This patch removes all traces of them.
Bug: T140710
Change-Id: I16a5d54b09e71997f80208db6f4fbdb040d03ab1
EventMapper->fetchById() has retry on master built-in but it doesn't
kick in in a Job because the load balancer is a new instance and doesn't
know about previous writes.
This change makes the job always read from master to make
sure the event is found. It is going to write to master
right after anyway.
Bug: T204894
Change-Id: I9a2873234f1dd5416e6c2bedeb904880d1f79562
It was sort of checked in an implicit and roundabout way, in the sense
that the preferences page checks this and forces the relevant
preferences to on or off. But this was difficult to discover, and it's
not clear if this works correctly when defaults change.
Instead, explicitly check whether the requested notify type is available
for the event's category. Also rewrite the entire method to use
array_filter().
Change-Id: I9502a42fc705b2e56ef5edab433f1804f2924359
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
When the location on disk of an icon is known,
load its content and turn it into a data uri
for the <img> tag.
Otherwise (when it's only configured with a url),
use the url in the <img> tag.
Bonus: the rasterized icons were a bit blurry
and they are now crisp.
Bug: T55479
Change-Id: I8b5d7f09d8181f22927b8d4712505212ea1a10b1
This trait was using private fields from its host classes
($this->event, $this->language). It created a weird coupling
situation where the host class uses the trait and the trait
uses the host class. Effectively a circular dependency.
Also, phan is complaining about it in
I65ae6adc10941c05a2646e551b1baa829e4e8654
Change-Id: Ib2796b7ca62ecd7ece19583d7ca83e4252a5d878
Do this by default in EventPresentationModel so it automatically works
for all email subject messages.
Update messages to use this parameter. Also update email subject
messages that were trying to use parameters that didn't exist, and fix
message documentation that was completely wrong about what the
parameters were.
Also update translated messages to account for parameter shifts (in many
cases, these messages were using the wrong parameter or a nonexistent
one).
Bug: T219620
Change-Id: Ia420c4db13c95d91e1bfc4c7950942df5858379b
It is already called with a context in SpecialNotifications
Set context on SpecialNotificationsMarkRead and pass title to html form
to pass texts
Change-Id: I24eb85648580ac1a4df5e7587806bad57c141785
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
This code improvements seeks to improve on code readability, consistency,
maintainability and efficiency.
Change-Id: I4f07886044e9a75824f9e7ddad039f3112b1c4a1
Incrementing user edit count was moved to a deferred update in
I0d6d7ddd91bbb21995142808248d162e05696d47
That causes the notification to lag behind, and the thank you notification is
sent for your first edit on the second, you 10th on the 11th, etc.
This change simply assumes one more edit than the current count unless it is
running from the CLI (this is needed for the test to continue to work).
Since the update job is mergeable, it is possible that a certain value will
be skipped and the notification for it never sent. See task for moe details.
Bug: T209541
Change-Id: Iea61b0f525be25f63f50582933a16a79a52e141f
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