Update the comment to reflect that the column content will be a
reference to an echo_push_topic row ID rather than topic text.
Bug: T261756
Change-Id: I456165df24ecc5a90d4ebcefe50f81459d7c352e
* DB changes
- Create a table for push topics NameTableStore
- Add a foreign key on subscriptions to normalize push topics
* Implement NameTableStore to normalize topics
* Update DB query joins to include topic from foreignkey
* Adapt code to use IDs instead of the actual topic
Bug: T261756
Change-Id: Ia7589f4a607993352d45b2dd3bcb3867d12d6e97
Creates a new push-subscription-manager group and an associated
right, manage-all-push-subscriptions. The purpose of this is to
allow privileged accounts to purge expired subscriptions from the
database on behalf of other users. A user with this right will be
permitted to delete any subscription from the DB based on the token
alone. For all other users, deletion requests will be limited to
those associated with the requesting user's central ID.
This right will be granted to a bot account on Metawiki associated
with the Wikimedia push notifications service, and the push
notifications service account will make push subscription delete
requests to the API for subscriptions for which vendor APIs return bad
subscription responses.
Additionally, the providertoken parameter to ApiPushSubscriptionDelete
is updated to allow multiple providertoken values.
Bug: T259148
Change-Id: Ia6c17588ee94e6be74e5e3a75eb33e38f172fc93
1) send apns topic when present in subscription metadata
2) check if subscription metadata is a valid JSON string
3) make epp_id column at echo_push_provider table auto_increment,
otherwise it will fail when trying to add a second row in the table
Bug: T259394
Change-Id: I785435e9f2d4ba9c14977d431d271f0fa2d0c795
Adds DB tables for storing push subscriptions, some DB interaction code
for retrieving them within MediaWiki, and a set of API modules for
managing them from the outside world.
When testing this patch, be sure to run maintenance/update.php to create
the new tables, and set $wgEchoEnablePush = true in LocalSettings.php
to enable the API new API module.
N.B. The current DB schema is centered on app push subscriptions. Web
push subscriptions require slightly different handling, since they are
provided by browsers as a JSON blob rather than a token string. How to
handle web push subscriptions is a question we can defer until the time
comes to add web push support.
Subscription data is stored in the echo_push_subscription table, with
provider names normalized into the echo_push_provider table. We expect to
be looking up subscriptions by central user ID, so that column is indexed.
The subscription data also includes a column to store SHA256 digests of
the subscriber tokens. This is for use as a unique key constraint, since
we expect every push token to be univerally unique, and the token values
themselves may be too large to reasonably index in MySQL.
Bug: T252899
Change-Id: I3928761b3fba12e54ff4850e9a05c68ec7772f62
column event_page_namespace was dropped from the database
When running the updater for sqlite on a fresh install it fails
Function: Wikimedia\Rdbms\Database::sourceFile(
/workspace/src/extensions/Echo/db_patches/patch-event_variant_nullability.sqlite.sql
)
Error: 1 no such column: event_page_namespace
Change-Id: I397e601dd9db45fc34669c43df5f9dd8d337ed95
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
Target page entries used to exist for each user
that was notified for an event. They were
removed as the notifications were marked as read.
Now they remain so that the association between
pages and events can be used for moderation
regardless of the notifications read status.
This patch removes everything about
echo_target_page.etp_user from sql and php code.
Bug: T143959
Change-Id: Ib57510e6b0e9202a7e035f8ea59955dca8a0b24a
To allow individual notifications to be
marked as read/unread or moderated,
bundles are created by grouping associated
notifications when they are fetched for display
instead of when they are created.
From a product perspective, this change doesn't
introduce moderation or expandable bundles but
it counts each individual notifications.
For instance, the bundled notification
"3 new topics on PageA" now counts as 3
notifications.
Bug: T93673
Bug: T120153
Change-Id: Iacd098573efd92bb1e3fcd7da4cd40cea9522f15
So we can easily query the notification rows that belong to
a given event row. This is needed for the removeOrphanedEvents
maintenance script to run efficiently.
Change-Id: I99fc31a62b37259d7000577583c8e8a599e400f9
This implements a backend layer and database storage for tracking what
wikis a user has unread notifications on. It is not yet exposed via any
API.
Whenever the notification counts on the local wiki are reset, a deferred
update is queued to also update the central database table.
Change-Id: Id1498bdeb5811d6848dc66781ffca03e726eab90
This will be used for marking a notificaiton as read when
a user visits a target page. The new table should keep the
volume as low as possible for fast data loopup. records
should be removed from the table once it's marked as read.
Change-Id: I605cbc79adfc12d22bd889c5bb513d05c479fe6e
SQLite requires unique index names across the full database. A previous
patch I9b6468221ba6fe501b15c563f3301694262eec65 renamed the index in
echo.sql but forgot to apply the same change to existing databases. This
resolves that mistake.
Change-Id: Ibb629149afd9f4ca55cac613124fce42500aa8f9
Sqlite's lack of an 'ALTER TABLE CHANGE' statement has prevented echo from
supporting sqlite, and by relation has prevented Echo's unit tests from
running within the foundations jenkins CI environment. This patch detects
if the database is currently an sqlite database and applies a specially
formulated patch that performs a rename/copy/delete operation to get
the equivilient of an 'ALTER TABLE CHANGE' command. Additionally renames
one index to have a more unique echo-specific name.
Bug: 41987
Change-Id: I9b6468221ba6fe501b15c563f3301694262eec65
Provides the first step of adding and populating a new database field
for Echo oversight deployment. The new field is populated via a
maintenance script and Event::loadFromRow will accept both new and old
results. Everything will still run when the 2 now unused fields are
later dropped from the db.
Bug: 48059
Change-Id: I24d4b61a061f94ed9aaaa6087f33b2ab37f773cd
* This patch needs intensive testing on Redis delayed job queue
* This patch is -2 mainly for redis/phpredis are not ready on test/test2/mediawiki
To test this locally, you need to:
* set up Redis and phpredis locally
* add the following to localSettings.php
$wgJobTypeConf['MWEchoNotificationEmailBundleJob'] = array(
'class' => 'JobQueueRedis',
'redisServer' => '127.0.0.1',
'redisConfig' => array( 'connectTimeout' => 1 ),
'claimTTL' => 3600,
'checkDelay' => true
);
* set $wgMainCacheType to CACHE_DB or memcache
* set $wgEchoBundleEmailInterval to smaller number for testing purpose, 0 to disable email bundling
Change-Id: I9313e7f6ed3e13478cec294b5b8408fe8e941faf
* add web bundling feature
* unify event_timestamp with notification_timestamp
* remove echo_subscription
* update article_link to page_link notification with new logic
* remove duplicated function from MWDbEchoEmailBatch since it's defined in parent class
Change-Id: I2fa91c44edb020209b468fe13f894d9db3732e69
patch set 3:
* add gender support to various messages
* tweak variables a little bit, e.g. move class variables to function local variables
patch set 4:
* update various email to e-mail in i18n file
* add support to process only valid echo events
* add global email footer
* add the new table schema to core schema file
patch set 5:
* remove trailing white space
* add missing semicolon to return statement in Notifier::notifyWithEmail()
patch set 8:
* some change based on newest feature requirement
Change-Id: I3298617dab4c04c4d6d486469120fc2d0c986b66
Uses the class EchoDiscussionParser to understand actions taken on
vanilla MediaWiki discussion pages.
Currently notifies on these occasions:
* A new comment is added to a discussion on your talk page or that
you have participated in.
* A new topic is added to your talk page.
There are vague plans to expand to these classes of events:
* Your comment is edited or removed.
* A large section is moved to your talk page.
and these classes of users:
* Users watching discussion pages.
Change-Id: Ie6cae76ed2e0ecf607059e39ac1aa480a275ec89
This version is very rough.
For an example set of Minimum Releasable Functionality, this version will notify users on
changes to their watchlists or to their user talk pages.
However, it is still missing a conversion script to turn watchlists into echo subscriptions.
For now, notifications can be viewed through the new special page Special:Notifications, or through the API module provided.
Change-Id: I5867226e3e6195fbed81f4b5803e2310f057ffc4