Go to file
Matěj Suchánek 4ae63d1b4d Avoid event insertion if possible
Why:
* On wikis with lots of bot activity like Wikidata, there is a large
  volume of edits which can potentially create an article-linked
  notification. These notifications are now actually rarely sent
  because they are disabled for bots (T318523). However, the event
  record is always inserted into the database, with no reference to
  it, bloating the database.

What:
* Do not unconditionally insert an event into the database when
  Event::create is called. Pass it to downstream calls and have
  it inserted when it's clear it will actually be needed (i.e.,
  a notification is definitely going to be created).
* Pass the event's payload to the job queue instead of requiring
  its ID. Introduce Event::newFromArray, which unlike ::loadFromRow
  handles ::toDbArray values that haven't been inserted into
  the database yet.
* Introduce Event::acquireId which ensures the event has been
  inserted prior to returning its ID as well as it does not get
  re-inserted.

Bug: T221258
Change-Id: I8b9a99a197d6af2845d85d9e35c6703640f70b91
2024-10-11 20:12:11 +02:00
.phan
i18n Localisation updates from https://translatewiki.net. 2024-09-30 09:21:00 +02:00
images
includes Avoid event insertion if possible 2024-10-11 20:12:11 +02:00
maintenance
modules Set Codex-token for @notification-background-unseen 2024-09-02 17:31:47 +02:00
scripts
sql
tests Avoid event insertion if possible 2024-10-11 20:12:11 +02:00
.eslintignore
.eslintrc.json
.gitignore
.gitreview
.mailmap
.phpcs.xml
.stylelintrc.json
.svgo.config.js
CODE_OF_CONDUCT.md
composer.json
COPYING
Echo.alias.php
extension.json
Gruntfile.js
jsdoc.json
package-lock.json
package.json
quibble.yaml
README.md
RELEASE_NOTES
ServiceWiring.php

The Echo extension provides an in-wiki notification system that can be used by other extensions.