Commit graph

4700 commits

Author SHA1 Message Date
Roan Kattouw fa21b7b0cd NotifUser: Un-merge getMemcKey() and getGlobalMemcKey()
We used to have code that called getMemcKey() with a boolean parameter
deciding whether to get a local or global key, but we don't do that
anymore: every code path now knows whether it needs a local or global
key. Consequently, move the code for global cache key generation back to
getGlobalMemcKey(), rather than having both be in getMemcKey() and
getGlobalMemcKey() being a wrapper.

Change-Id: If35bafc53e1e0086c31fd9675a9dc057e36f5717
2018-05-31 16:01:57 -07:00
Translation updater bot 3b6fdcfe59 Localisation updates from https://translatewiki.net.
Change-Id: I9ebd5a9c756fabc5949542820b47691dc90af8e0
2018-05-31 22:28:28 +02:00
Roan Kattouw 1fec0793e1 NotifUser: Remove $dbSource parameter from resetNotificationCount()
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
2018-05-31 00:53:06 +00:00
Roan Kattouw 0edd96da17 NotifUser: Add a doc comment for getForeignCount()
Change-Id: I47fc2d879b6292d70ba53f8a52f450eed83cfcb6
2018-05-31 00:52:59 +00:00
Roan Kattouw 5935a63731 NotifUser: Simplify timestamp comparisons in getForeignTimestamp() too
Change-Id: I89e75eeded95f7417f8fccfa6274fa19ff5a26c7
2018-05-31 00:52:52 +00:00
Roan Kattouw d90e2d1066 NotifUser: Redo caching strategy for multi-DC compatibility
To use WANObjectCache correctly in a multi-DC-safe way, we need to use
getWithSetCallback() to read data, and call delete() when it changes.
NotifUser's caching of notification counts and timestamps relied
heavily on set() calls, and so wasn't multi-DC-safe.

Changes in this commit:
* Rather than caching counts/timestamps in separate cache keys, and
  using separate cache keys for each section (alert/message/all), put
  all this data in an array and store that in a single cache key.
  This reduces the number of cache keys per user per wiki from 6 to 1.
* Similarly, use a single global cache key per user. The global check
  key for the last updated timestamp is retained, so we now have
  2 global cache keys per user (down from 7)
* Remove preloading using getMulti(), no longer needed
* Move computation of counts and timestamps into separate compute
  functions (one for local, one for global), and wrap them with
  a getter that uses getWithSetCallback().
* Use TS_MW strings instead of MWTimestamp objects internally, to
  simplify comparisons and max() operations.
* Make existing getters wrap around this new getter. They now ignore
  their $cached and $dbSource parameters, and we should deprecate/change
  these function signatures.
* In resetNotificationCounts(), just delete the cache keys. In global
  mode, also recompute the notification counts and put them in the
  echo_unread_wikis table. We could also set() the data into the cache
  at this point, but don't, because you're not supposed to mix set() and
  getWithSetCallback() calls and I don't want to find out what happens
  if you do.

Bug: T164860
Change-Id: I4f86aab11d50d20280a33e0504ba8ad0c6c01842
2018-05-30 17:49:48 -07:00
jenkins-bot bb3cb12262 Merge "CachedList: Use getWithSetCallback()" 2018-05-30 21:55:07 +00:00
jenkins-bot 0aef7d8d94 Merge "NotifUser: Make resetNotificationCount() default to DB_MASTER" 2018-05-30 21:55:06 +00:00
jenkins-bot e03f04be89 Merge "Fix config documentation" 2018-05-30 20:55:33 +00:00
Translation updater bot 5cfd644d5b Localisation updates from https://translatewiki.net.
Change-Id: Ib938907f0756869dfe0cf3a98c6a6364a25ec2cc
2018-05-30 22:24:36 +02:00
Ed Sanders 0f7afb1e5d Convert SpecialHelpMenuWidget to a customised DropdownWidget
Replace the handle with a button widget.

Also remove the unused PendingElement mixin.

Bug: T178387
Change-Id: Iec3afea6c6a8fdb49e17750af7bada42b7ed4b70
2018-05-30 18:57:07 +01:00
Ed Sanders bd2f39ca78 Fix config documentation
Only document config properties used in the current class,
and add missing ones.

Change-Id: I5573f7166fee0409faae7b3af8280aa918fa3dcd
2018-05-30 17:47:20 +00:00
jenkins-bot c6f3909a6f Merge "Replace .parent with .super" 2018-05-30 15:28:37 +00:00
jenkins-bot 58e3c25729 Merge "build: Extend 'svgmin' options and move to 'minify' task" 2018-05-30 15:24:35 +00:00
jenkins-bot 8eba5bba4e Merge "build: Updating mediawiki/mediawiki-codesniffer to 20.0.0" 2018-05-30 15:24:34 +00:00
jenkins-bot 7c7e1763e4 Merge "tests: Delete the rspec tests" 2018-05-30 15:24:33 +00:00
Roan Kattouw 5c33f929bf CachedList: Use getWithSetCallback()
Bug: T164860
Change-Id: I0d89865fadcbc7f014e2d88a9a984228d44bc1c6
2018-05-30 05:15:20 +00:00
Roan Kattouw 32b82fa1fe NotifUser: Make resetNotificationCount() default to DB_MASTER
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
2018-05-30 05:14:38 +00:00
Roan Kattouw 544129492d UnreadWikis: Check the actual object we're about to call a method on
In principle, if $alertCount > 0, $alertTime should never be null,
but it feels much safer to check $alertTime itself instead.

Change-Id: Ifb107e257fbcd65e8181e2a214028f1b3733ac30
2018-05-30 05:03:51 +00:00
Roan Kattouw e29d1253b3 UserNotificationGateway: Add getDB() method
So that classes that get a UserNotificationGateway dependency-injected
into them can get something to call Database::getCacheSetOptions() on.

Change-Id: Ie1c98f09d1581ea17809a4dfc68adec1e2805580
2018-05-30 05:02:17 +00:00
Roan Kattouw 0483c5ff67 EchoHooks: Fix copypasta in link to documentation page
Change-Id: Ic39468363a7c44d69f01d76ed6500104610b5ee0
2018-05-30 04:17:57 +00:00
Roan Kattouw 6cdebeb6ab tests: Delete the rspec tests
They keep failing intermittently in CI.

Change-Id: I4370eb0169b9dbd3a6578a94700c85d3b53ef933
2018-05-29 16:56:09 -07:00
jenkins-bot 6d9fba9e7e Merge "NotificationItemWidgets: Remove property setting duplicated from parents" 2018-05-29 21:20:31 +00:00
jenkins-bot 10cdc61aa1 Merge "EventPresentationModel:🏭 Force type Language for $language" 2018-05-29 21:18:07 +00:00
Translation updater bot be3ede420c Localisation updates from https://translatewiki.net.
Change-Id: I724d72ea6561450f25e637d0fe801774eaef26c0
2018-05-29 22:24:49 +02:00
Volker E b3b9720733 build: Extend 'svgmin' options and move to 'minify' task
Also re-crush all SVGs.

Bug: T185596
Change-Id: I9f2be4b1b5c4c0597d4040250d87c939567cb83b
2018-05-29 10:26:22 -07:00
Translation updater bot 08e6ea82d1 Localisation updates from https://translatewiki.net.
Change-Id: Iefb4bb4a304f435b9889eeca06cda47082a6425b
2018-05-28 22:42:07 +02:00
Fomafix e20d0aaf4d EventPresentationModel:🏭 Force type Language for $language
The call of wfGetLangObj() is not necessary anymore.

Depends-On: I36834dbd119f4299f84b3dfe5e085eb0f6b8499c
Change-Id: I4e047393eee337432dd5edd0b4e3d650b6c7d393
2018-05-28 08:00:06 +02:00
libraryupgrader d1ef3a9514 build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
Change-Id: I69d6907eadd607cbeaef63d813ef79aea4e7983c
2018-05-26 02:15:41 +00:00
Translation updater bot bd847db719 Localisation updates from https://translatewiki.net.
Change-Id: Id6b188ef9816636345fbb58da138ad051efb7582
2018-05-25 22:14:12 +02:00
Translation updater bot a047843798 Localisation updates from https://translatewiki.net.
Change-Id: I6dee619884117a7bd72202a3c21667ca90dfb202
2018-05-24 22:24:46 +02:00
jenkins-bot 056a13eca9 Merge "Update icons to latest WMUI designs" 2018-05-24 10:50:28 +00:00
Ed Sanders e0770024cf Update icons to latest WMUI designs
Bug: T183749
Change-Id: I620438adef9ad0c39e66a790c29efb30af556cdd
2018-05-23 23:49:55 +00:00
Translation updater bot d0e8a885c0 Localisation updates from https://translatewiki.net.
Change-Id: I8c72ade404e92b2ff21cc7f94284a1011fbdbed4
2018-05-23 22:20:13 +02:00
Ed Sanders 9de02857ae Replace .parent with .super
Also remove unused config fallbacks

Change-Id: I10b1ffc0cf69c52c4394f27c02aac5bca2473374
2018-05-22 15:56:46 +01:00
Ed Sanders 3b4be7b6c5 NotificationItemWidgets: Remove property setting duplicated from parents
Change-Id: I03c83d3cfb6ce22ccca0cc2dc1d1e20b36d739c8
2018-05-22 15:54:55 +01:00
Ed Sanders e204977063 Make 'links' a required argument of NotificationBadgeWidget
Change-Id: Ib1ae2cf1edc1d0a280eb62558d93d081f365ca84
2018-05-22 15:42:45 +01:00
Translation updater bot 4c401d99e9 Localisation updates from https://translatewiki.net.
Change-Id: I74870c42fa4d6f18521f154f3bc1cefe2dd6c11c
2018-05-21 22:10:19 +02:00
Roan Kattouw af323781ab Follow-up 8b84ed2a3: fix eslint failure that snuck in somehow
Change-Id: Iad32afab81d1fc161b2f1e7f04bd8cd89937527e
2018-05-19 14:36:55 +02:00
jenkins-bot 941e1a65df Merge "Use static newFromID instead of loadFromID" 2018-05-19 11:57:00 +00:00
Translation updater bot 5477332a30 Localisation updates from https://translatewiki.net.
Change-Id: I0dc157aad7278873fdb1aca28f3be163ae729a20
2018-05-18 22:48:21 +02:00
Stephane Bisson 4690c2fb47 Use static newFromID instead of loadFromID
Bug: T192945
Change-Id: Ifd7c40dfef5147581a59d39a6dbe7312a9b82cc6
2018-05-17 22:29:09 +02:00
Translation updater bot b3dd092832 Localisation updates from https://translatewiki.net.
Change-Id: I4ff6b767edf3f9c806dcc1e49a0f60a4e07497a9
2018-05-17 22:19:37 +02:00
Translation updater bot 1a2fde884b Localisation updates from https://translatewiki.net.
Change-Id: I2b1d1754f9548b89588980c54253a756f1084b34
2018-05-15 22:24:36 +02:00
Translation updater bot 1a2b3eeb8e Localisation updates from https://translatewiki.net.
Change-Id: I8e03072e91ef47932e0dd306d43158b28c3eb899
2018-05-13 22:18:04 +02:00
Translation updater bot a4ea9ac892 Localisation updates from https://translatewiki.net.
Change-Id: Ie2492ed1ca8f25e465b31f5988d6369e435c546d
2018-05-10 22:20:28 +02:00
jenkins-bot 45f360f25f Merge "Make NotificationJob json-serializable" 2018-05-09 22:01:46 +00:00
Kunal Mehta c21cf466e3 Add Roan to authors list
Change-Id: Ief93f9e95af6ea05624433c41d14e0b28f8fbe59
2018-05-09 07:52:05 -07:00
Translation updater bot 138d56ad0c Localisation updates from https://translatewiki.net.
Change-Id: Ia3d29ee4a0a54812dc5afeeb171e685d7570eb19
2018-05-08 22:19:52 +02:00
Stephane Bisson be88fc58c1 Make NotificationJob json-serializable
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
2018-05-08 15:52:55 -04:00