Commit graph

653 commits

Author SHA1 Message Date
Stephane Bisson bfcfdded40 Special:Notifications (no-js): filter out deleted events
Change-Id: Ie2e6b3ba388650f28ddc050624a52c410248fbd8
2016-07-25 12:21:14 -04:00
Aaron Schulz 9d436067a7 Convert deferred update to using AtomicSectionUpdate
Change-Id: Ic30a940d243986e71cfc8e66a70c0c2e77438506
2016-07-21 23:43:21 -07:00
jenkins-bot f79b4ebca5 Merge "Documentation for EventPresentationModel" 2016-07-21 17:35:26 +00:00
Stephane Bisson a77d75c3ee Documentation for EventPresentationModel
Change-Id: Ia620bd1a2a562c606752195cb459dc46d41db7b2
2016-07-21 12:25:46 -04:00
Stephane Bisson a4e7bee5ef Exclude deleted events from UnreadNotificationPages API
Change-Id: I1eb1be1de1af884715e8a3b85f18770e6f0d6ff2
2016-07-21 14:10:40 +00:00
jenkins-bot bf502f89a0 Merge "Allow requesting TS_ISO_8601 for ApiEchoMarkSeen, and deprecate TS_MW" 2016-07-21 02:04:06 +00:00
Matthew Flaschen 756948d489 Allow requesting TS_ISO_8601 for ApiEchoMarkSeen, and deprecate TS_MW
(Previously TS_MW was the only possibility).

Per https://www.mediawiki.org/wiki/API:Data_formats#Timestamps

Bug: T139993
Change-Id: Ief9a720a5053ee153b84edb64524aa4743cc76f1
2016-07-20 18:22:28 -04:00
jenkins-bot 3fd553a152 Merge "Add seen time to output of API, in ISO 8601 format" 2016-07-20 16:31:54 +00:00
Matthew Flaschen c05133283a Add seen time to output of API, in ISO 8601 format
Like count, it is available both grouped by section and ungrouped
(top-level).

Unlike count, the top-level still has both sections (but with the
string 'seenTime' at the root), and if groupbysection is used,
it will not also have top-level (since it would be redundant).

Example output at T139993

It will be false or omitted if there is no seen time, depending
on JSON format version (2+ is false).

Bug: T139993
Change-Id: I9f4f9df69203204b56002afa1be6ed2336c33898
2016-07-20 09:25:03 -07:00
Stephane Bisson cf71009638 Remove deprecated formatter
Followup to I639b9d9906d3ff37021cb9b5ed3cb401354b5bd9

* Remove deprecated formatter
* Log a warning and fail gracefully
  when an event type does not support
  Echo presentation model.

Bug: T121612
Change-Id: Ic5712c4ce265b6faabce7a4028b4294fe3c73f18
2016-07-20 11:00:34 -04:00
jenkins-bot 059bcbe95f Merge "Cleanup old notification formatting system" 2016-07-19 22:19:57 +00:00
jenkins-bot 414a1a189d Merge "Optimize DiscussionParser.php" 2016-07-19 22:10:35 +00:00
jenkins-bot 3d258c7929 Merge "Use StatsdDataFactory service instead of deprecated RequestContext method" 2016-07-19 21:21:52 +00:00
jenkins-bot 76e6d545fb Merge "Check for empty array before calling max()" 2016-07-19 20:33:04 +00:00
Matthew Flaschen c1365be90d Fix typo (canUseCentralAuthl -> canUseCentralAuth)
Change-Id: Ic27240df0744c6025e7b1922d31250377f0a2bc4
2016-07-19 10:16:57 -07:00
jenkins-bot c17c6625a6 Merge "backfillUnreadWikis: Skip updateCount if race condition detected" 2016-07-19 01:18:53 +00:00
Matthew Flaschen ed626af0ad backfillUnreadWikis: Skip updateCount if race condition detected
Related doc fixes

Change-Id: I1b7545d2f86ec87e9701811ac5f4db0fec690681
2016-07-18 20:58:48 -04:00
Roan Kattouw 83a181ce9c ForeignWikiRequest: Also check User::isSafeToLoad()
Check it for both $wgUser and $this->user because they
could theoretically be different.

Bug: T139665
Change-Id: I59cb4f0122a9fccb32ca165fda065dee2467b1da
2016-07-18 14:49:43 -07:00
Leszek Manicki 6dcb872a7b Use StatsdDataFactory service instead of deprecated RequestContext method
Change-Id: Ie291146f67b525d891614c23b17052500fc8aa51
2016-07-15 18:03:47 +02:00
matejsuchanek d53e2cc75f Optimize DiscussionParser.php
Change-Id: I57c422d4c276062d4d55c9a8f580a22ef318f732
2016-07-13 17:31:06 +02:00
Matthew Flaschen 8f7499286d getCentralAuthToken back to protected.
This was for testing, I didn't mean to commit it.

Follow up 03262edf24

Change-Id: Ia5e8ec482d5b32891de67fe3da6e8c52cca099e9
2016-07-12 18:45:31 -04:00
Matthew Flaschen e578bb4ab4 CentralAuth: Bail if not fully initialized
Bug: T140144
Change-Id: I2bc242e98f864af50af5545424a4da318abc360f
2016-07-12 16:31:53 -04:00
Matthew Flaschen 03262edf24 Troubleshoot why Echo is still triggering CA failures
If we have a central ID, in theory it should not trigger
CA failures when getting a token.  However, it is, so maybe:

* This is the wrong way of checking attached-ness.
* It is somehow losing the central ID later.

or something else is going on.

Bug: T140144
Bug: T119736
Change-Id: I71c6f121a728e503aa9d62778e64c650cd8d46af
2016-07-12 15:07:01 -04:00
Roan Kattouw e63b8799a4 ForeignWikiRequest: Bail early for non-global users
Attempting to get a CentralAuth token for an unattached
user (or a user mid-attachment) throws an exception.

Bug: T119736
Change-Id: I2a34754f55b952f5bcd4da6c6f89a32ebc29ecf1
2016-07-12 09:05:30 +02:00
Stephane Bisson 2f0ff9cbf6 Cleanup old notification formatting system
* Deprecated main entry-points
* Removed unused configuration
* Removed old formatters for Echo events (mention, edit-user-talk, etc)
* Removed unused messages

Bug: T121612
Change-Id: I639b9d9906d3ff37021cb9b5ed3cb401354b5bd9
2016-07-11 16:57:14 +00:00
jenkins-bot 3eda03ac98 Merge "Special:Notifications JS even when no local notifications" 2016-07-08 18:19:49 +00:00
jenkins-bot 5dfdafcbb5 Merge "Fix E_NOTICE due to event_deleted missing on foreign psuedo-notification" 2016-07-08 13:28:42 +00:00
Matthew Flaschen 5c8eb10795 Fix E_NOTICE due to event_deleted missing on foreign psuedo-notification
Bug: T139536
Change-Id: Ie4536543bdc39abc55ecfc3224845ff6c97069ea
2016-07-08 01:51:11 +00:00
Moriel Schottlender 7879f0c9f8 Change 'messages' to 'notices' throughout the interface
Bug: T139520
Change-Id: Ib7f4dc4ea1ff4c5d1fccdc5fdf0c66b049162cb2
2016-07-07 15:57:49 -07:00
jenkins-bot 635f1471af Merge "Sort bundled notifications by read status AND timestamp" 2016-07-07 19:36:30 +00:00
Stephane Bisson ebd616d6f3 compact-header should be parse because it includes formatting
Bug: T139602
Change-Id: I3c9fd6cd6b5b805b7867de6ee2cb3555a5d0d123
2016-07-07 13:16:26 -04:00
Stephane Bisson 4659b00d94 Check for empty array before calling max()
When trying to find the max timestamp of all
notifications in one source or the max timestamp
between all the sources, check for empty array
to avoid "Warning: max(): Array must contain at
least one element...".

Bug: T139529
Change-Id: I0bf04ded40872c1c7a0cd3a9a62bc789814f5419
2016-07-07 09:03:09 -04:00
jenkins-bot 1bc15bb805 Merge "Notification count: don't assume 'all'" 2016-07-06 22:20:44 +00:00
Stephane Bisson 194b9c78a4 Notification count: don't assume 'all'
Bug: T139323
Change-Id: I44ebdc600015bdfadc07e313689b8fad1d1c60c0
2016-07-06 21:04:49 +00:00
Stephane Bisson db838e42ce Keep bundled notification compact header on one line
Bug: T139321
Change-Id: I4b0a7173bc06a0760efff544bcc28a59ba72ce7f
2016-07-06 20:44:00 +00:00
Stephane Bisson b215a5d7c0 Sort bundled notifications by read status AND timestamp
Change-Id: I21b00622828c5c518cf83e78457134a66ac71947
Bug: T139521
2016-07-06 16:02:04 -04:00
Stephane Bisson 90bc75912c Special:Notifications JS even when no local notifications
Launch JS version of Special:Notifications even of the
user doesn't have any local notifications.

Bug: T139512
Change-Id: Ia01a57de307b0d7da6a7d81ec8ee32d02ccc1887
2016-07-06 15:24:46 -04:00
Roan Kattouw f62106f740 ApiEchoNotifications: Don't add wikis with no timestamp
This should prevent fatals in the sort-by-timestamp code
farther down, and also prevent incorrect output.

Bug: T139112
Change-Id: I6480b2e751594ba3392322f40e950f95ae702104
2016-07-01 21:17:29 +02:00
jenkins-bot 71bfae12c3 Merge "Change wfWikiId (lowercase d) to wfWikiID (uppercase D)" 2016-06-29 13:29:44 +00:00
Matthias Mullie 620d50f23f Change wfWikiId (lowercase d) to wfWikiID (uppercase D)
PHP can handle incorrect capitalization, but we should use the correct function
name.

Change-Id: I6db9bb90a8573f65cde503b771c9539faf38e75e
2016-06-29 15:11:21 +02:00
Stephane Bisson 5ffbc4db97 Fix foreign bundle count
Use foreign source reported notifications count
instead of counting the actual objects.

Counting objects is wrong because of bundles
that are 1 object but represent multiple notifications.

Bug: T138888
Change-Id: Ib63efc1e33af8f4364a7ba11a0dc3ff820f0a03c
2016-06-29 09:09:55 -04:00
Stephane Bisson f8a8d392d6 Expandable bundle
Support bundles being expandable
to show their sub-notifications.

Bug: T114356
Change-Id: I1507cae360f45cc87f2d60e966b4d047abfa202d
2016-06-28 15:37:54 -04:00
jenkins-bot 731cde01b8 Merge "Dynamic bundles" 2016-06-28 19:34:42 +00:00
jenkins-bot 8ca3bbac5e Merge "Mention notification: don't repeat the section title at the begining of the excerpt" 2016-06-28 19:13:00 +00:00
Stephane Bisson 23691d73d1 Mention notification: don't repeat the section title at the begining of the excerpt
Bug: T134922
Change-Id: I731ed9a7fafa7964aca776c543a58f6c5692f89a
2016-06-28 09:48:38 -04:00
Stephane Bisson cf7bee76ee Don't send empty emails
If no notification can be rendered,
don't send an email at all.

Bug: T137012
Change-Id: I57944e7af275ddecdffc82de8c050d8baa357660
2016-06-28 09:19:01 -04:00
Stephane Bisson 24caf50ff6 Dynamic bundles
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
2016-06-27 09:49:13 -04:00
jenkins-bot 79aad8f479 Merge "Add support for querying notifications not associated with any page" 2016-06-27 13:35:02 +00:00
Roan Kattouw 7d97881344 Add support for querying notifications not associated with any page
Uses the magic value '[]' to mean 'no title'. This is a bit ugly,
but I think introducing an additional &notwithouttitle=1 parameter
is uglier and results in more code.

Change-Id: I83278182aeaf3905eb0f3e24c4c6c247720b1e76
2016-06-24 00:37:21 +02:00
jenkins-bot 2eabf079f8 Merge "Clean up and fix updateEchoSchemaForSuppression.php" 2016-06-23 20:38:04 +00:00