Commit graph

3241 commits

Author SHA1 Message Date
Roan Kattouw ac85f28f3e Use global user ID in global cache keys
We were using the local user ID instead, which is not the
same on every wiki, which caused strange cache staleness
and pollution behavior.

Run sets through a wrapper function (gets were already wrapped)
so we can update the instance cache and deal with uncomputable
cache keys in one place. A global cache key may be uncomputable
if we fail to obtain the user's global user ID (users aren't
supposed to be unattached, but some are).

Also bump the cache version to get rid of polluted cache entries.
Bumping this version number was probably a good idea anyway,
with all the recent changes.

Bug: T134533
Change-Id: I1c4f0c2f2eded480c80f8ec7a49a04feb7c5ecfb
2016-05-05 17:21:32 -07:00
Roan Kattouw e57dbfc86b Follow-up 73ec3a331: fix fatal when no cross-wiki results are found
If we don't initialize $results, getForeignNotifications() will return
null, and this will cause a fatal when trying to += it into an array.

Change-Id: Ibb868cbf0b52ff2de41c5be82c9605801e51ffae
2016-05-05 12:58:28 -07:00
Moriel Schottlender 7055f83fe0 Use server-side cross-wiki requests in the frontend
Fetch cross-wiki notifications by asking the local API, but still
maintain the ability to send remote requests to the foreign wikis
for mark-as-read operations.

Bug: T130636
Change-Id: I48524cb9dff43257a401d7483e939edfb042b928
2016-05-04 21:21:08 +00:00
Translation updater bot 9462f0c90a Localisation updates from https://translatewiki.net.
Change-Id: Iad7b22cc1c9f1e720866c3d0cdf2b85193cd6d4c
2016-05-04 22:23:05 +02:00
Kunal Mehta b6f742bc46 Add plain text email formatter
Formatters based on presentation models for
individual event emails and digest (daily, weekly)
plain text emails.

Bug: T121067
Change-Id: I4eceaf521315adab7429a8a73ffca70ebcddab86
2016-05-04 13:35:37 -04:00
jenkins-bot 19b051164b Merge "Use MultiHttpClient for server-side cross-wiki requests" 2016-05-04 17:15:29 +00:00
jenkins-bot f4897e11b2 Merge "Server-side crosswiki requests" 2016-05-04 17:13:23 +00:00
jenkins-bot 2939093854 Merge "Clarify beta feature description" 2016-05-04 12:00:11 +00:00
jenkins-bot f08b108e2e Merge "Replace mark-as-read-on-click with ?markasread= URL parameter" 2016-05-04 01:09:27 +00:00
Roan Kattouw 73ec3a331e Use MultiHttpClient for server-side cross-wiki requests
Change-Id: I6d647f250941a671b7b63890ef115380a22d38cc
2016-05-03 17:46:59 -07:00
Matthias Mullie ae3e8a6b8c Server-side crosswiki requests
Passing a param 'wiki' with a list of wiki names will now
result in getting notifications from these wikis too.
It'll execute multi-curl calls to the given wikis to fetch
their results.

Bug: T130636
Change-Id: I89df54366501acfe3e5cf6d2f313ee32694ba387
2016-05-03 17:45:45 -07:00
Translation updater bot 40d1986e89 Localisation updates from https://translatewiki.net.
Change-Id: I1576eee5ad0f89c2cba1e68c1ee81c3a028aa912
2016-05-03 22:24:40 +02:00
jenkins-bot a966e1825f Merge "NotifUser: Reduce queries in resetNotificationCount() by hackily computing some values from others" 2016-05-03 13:43:42 +00:00
jenkins-bot f101accfe5 Merge "NotifUser: Refactor getNotificationCount() and friends, add caching for global counts" 2016-05-03 13:39:04 +00:00
Roan Kattouw 7942a2de79 Replace mark-as-read-on-click with ?markasread= URL parameter
Notifications were being marked as read in response to a click event
in JavaScript, but that causes a jarring effect in the UI, and it's
not reliable (the browser could abort the AJAX request).

Instead, add ?markasread=XYZ to the end of every primary link URL,
where XYZ is the event ID.

Bug: T133975
Depends-On: Icb99d5479836fea25a47451b5a758dd71f642f71
Change-Id: I8047d121584b43e6172463a50ad0e0de5f7fa73c
2016-05-03 00:20:03 -07:00
Roan Kattouw 1b7c2c781a NotifUser: Reduce queries in resetNotificationCount() by hackily computing some values from others
Change-Id: Id349ac91c7ed8f308fce327bbf5f5e5f088b7935
2016-05-02 23:17:18 +00:00
Roan Kattouw 0807c3c5ad NotifUser: Refactor getNotificationCount() and friends, add caching for global counts
Previously, getNotificationCount() only looked at local notifications,
and foreign notifications were added in separately by getMessageCount()
and getAlertCount(). This didn't make any sense and resulted in
counter-intuitive things like I4d49b543.

Instead, add a $global flag to getNotificationCount(). If $global=false,
the local count is returned as before, but if $global=true, the
global count (=local+foreign) is returned. If $global is omitted,
the user's cross-wiki notification preference determines which is returned.

Update getLastUnreadNotificationCount() in the same way, since it had
the same issues.

Also add caching for global counts and timestamps, using a global
memc key.

Bug: T133623
Change-Id: If78bfc710acd91a075771b565cc99f4c302a104d
2016-05-02 16:16:57 -07:00
Roan Kattouw d6aba7613e Clarify beta feature description
Bug: T134014
Change-Id: I933169e2d7a6e1cc5a4e7134748702f8efb21b85
2016-05-02 15:16:53 -07:00
Roan Kattouw 73b0a083d4 FooterNoticeWidget: Top-align the close icon
Bug: T117669
Change-Id: I70d8df95e719824c8f135d01d6d9bf63a20daf02
2016-05-02 14:36:01 -07:00
jenkins-bot 3f4e024f3a Merge "Move section methods into a trait" 2016-05-02 12:29:39 +00:00
Translation updater bot d0007081d6 Localisation updates from https://translatewiki.net.
Change-Id: I01d80d43486516e8ee44667491ee1e531eb93333
2016-05-01 23:16:51 +02:00
Translation updater bot 396dc318a2 Localisation updates from https://translatewiki.net.
Change-Id: I08da917f6231ce9867370e0d699494223ad2bc56
2016-04-29 22:34:28 +02:00
Roan Kattouw 6a626e2685 Enable emailuser notifications by default
Bug: T133927
Change-Id: I3cbbc4b5980e61fba9d71d12684db0f1be2db6af
2016-04-28 17:01:24 -07:00
Matthew Flaschen bd317224ac Have getTimestamp actually return max for all sections.
Before, it was just returning the timestamp of the messages section.

Tested by creating a message on one foreign wiki, then an alert on
another and using:

http://mobile.wiki.local.wmftest.net:8080/w/api.php?action=query&format=jsonfm&meta=notifications&notsections=message|alert&notformat=model&notlimit=25&notunreadfirst=1&notprop=list|count&uselang=en&notcrosswikisummary=1&_=1461881446668

Change-Id: I870229b09a8add08eb3542e3ab70db58352d00b8
2016-04-28 23:26:13 +00:00
Catrope 3a018f9e10 Revert "Localisation updates from https://translatewiki.net."
Removed qqq which broke banana, again.

This reverts commit 8037ff307b.

Change-Id: I9088e5de5900f833b28c203d81b935fe0d827be7
2016-04-28 22:52:04 +00:00
Translation updater bot 8037ff307b Localisation updates from https://translatewiki.net.
Change-Id: I9ff1f66950aedc768a08fb62dcdda63414b85e99
2016-04-28 23:27:52 +02:00
Roan Kattouw 33124f35a8 Move section methods into a trait
Change-Id: Ief2005918b92945ff93aea85d17e595c7c38adf2
2016-04-28 20:52:09 +00:00
Matthew Flaschen 6d6845d9e4 Display special: Add which section (curr. Alert v. Msg.) each type's in
Replace getAlertEvents and getMessageEvents with
getEventsForSection.

Also, add IDs for linking to sections

Bug: T123018
Change-Id: Ic480320a52a401609d853fc8c75c781b89bb8722
2016-04-28 20:33:52 +00:00
Roan Kattouw e864b1fc47 ForeignNotifications: Fix fatal when one section has no timestamp
Bug: T133921
Change-Id: Iab82fa9439e26832731f4f56b5be18985203f49c
2016-04-28 10:39:05 -07:00
Roan Kattouw fbf702aa7e Follow-up 1608a5e6fc: add hasOwnProperty check
To prevent crashes when wikis extend Array.prototype.

Bug: T133817
Change-Id: I40063d7997a1dfb72053eb09e48d4480dbf371a8
2016-04-28 00:34:11 +00:00
Catrope f37585b947 Revert "Localisation updates from https://translatewiki.net."
Undid changes to qqq.json, which broke banana-checker.

This reverts commit 7b4dd7d046.

Change-Id: I5ed1c8913e8e8538023c1dfd91bc2287a271c995
2016-04-28 00:09:30 +00:00
Translation updater bot 7b4dd7d046 Localisation updates from https://translatewiki.net.
Change-Id: If22e1f6da05323b240b9c12810c3088354f0c9e5
2016-04-27 22:54:08 +02:00
jenkins-bot ff67a0377b Merge "Repurpose survey call-out in the footer for beta feature invitation" 2016-04-27 19:53:34 +00:00
jenkins-bot e4d953168b Merge "ForeignNotifications: Move preference check out of constructor and allow force-enable" 2016-04-27 16:57:47 +00:00
jenkins-bot 56b4f161e4 Merge "Clean up section title handling in mention and edit-user-talk presentation models" 2016-04-27 16:29:49 +00:00
Roan Kattouw 314e00def5 ForeignNotifications: Move preference check out of constructor and allow force-enable
Instead of checking the cross-wiki notifications preference
in the constructor, move it to a method that other code can reuse.
Also add a parameter allowing foreign notification data to be
inspected even if the user has disabled the preference.

Change-Id: I6600ff27aa5af1737b3a6c3cde586d325886bc86
2016-04-27 16:23:21 +00:00
jenkins-bot ae9b7b80bd Merge "ForeignNotifications: Use ALL instead of null as defaults for $section params" 2016-04-27 16:16:53 +00:00
Roan Kattouw d8bf305e68 ForeignNotifications: Use ALL instead of null as defaults for $section params
Change-Id: Ieab7090742fd7f75c079be72cd9c07e3e1448ed1
2016-04-27 08:31:15 -07:00
jenkins-bot 84074fb799 Merge "Make EchoForeignNotifications::getApiEndpoints() static" 2016-04-27 15:06:42 +00:00
Roan Kattouw 4f7f1a3a09 Repurpose survey call-out in the footer for beta feature invitation
Removing the info popup because we don't have to show
a privacy notice when linking within the wiki.

This adds a database query to every page view for logged-in
users; If78bfc710, once merged, will fix that.

Bug: T117669
Change-Id: I8451db34ae8e94264e4921ecd6df6e4b32c7623a
2016-04-27 07:23:30 +00:00
Roan Kattouw 5152385887 Make EchoForeignNotifications::getApiEndpoints() static
It doesn't use $this, except to call getWikiTitle(), so make that
static too. This allows us to use it in EchoForeignPresentationModel
without creating a second instance there.

Change-Id: If778db0852de1cbf5c2190ce50ce561745bb3887
2016-04-26 17:33:30 -07:00
Roan Kattouw 1608a5e6fc Follow-up b10bd7003: allow object instead of array for b/c with wikis running old code
Change-Id: I1566b73e0d8daea6c2e701f60cbcb9dd42129ec9
2016-04-26 15:57:25 -07:00
Roan Kattouw 91a7833209 Follow-up 57ee9759: add notnoforn=1 for b/c with wikis running old code
Change-Id: I24b697d59f9306b9cfa40372c5d4a92ba331b20b
2016-04-26 15:55:07 -07:00
jenkins-bot 605f28effe Merge "Remove forced -p (progress) flag from phpcs.xml" 2016-04-26 21:38:45 +00:00
Roan Kattouw cf1da49904 Remove forced -p (progress) flag from phpcs.xml
This causes phpcs to emit invalid JSON when the --report=json
flag is set and no issues are found, which breaks editor plugins
(atom-linter-phpcs in my case).

Add this flag in composer.json instead.

Change-Id: Ibb0b4c084e25e06be72389f1d4998804cfd53295
2016-04-26 14:21:28 -07:00
Translation updater bot 0503734eb9 Localisation updates from https://translatewiki.net.
Change-Id: Idc05bc28f76e543be5cce5c406ac2869cee5acbf
2016-04-26 22:27:21 +02:00
Željko Filipin ef7e22786e Do not run broken Selenium test in CI
Bug: T128190
Change-Id: Iadaede037ed0d4560c56ed9f06bcd96eff1e9f58
2016-04-26 15:51:15 +00:00
Translation updater bot a3482ef810 Localisation updates from https://translatewiki.net.
Change-Id: Iefefd6e959aa26d46fd7452dc6cfdd5e225f134a
2016-04-25 22:46:34 +02:00
jenkins-bot 29b0fb5688 Merge "Migration of browsertests* Jenkins jobs to selenium* jobs" 2016-04-25 16:12:17 +00:00
Željko Filipin 269d965a4a Migration of browsertests* Jenkins jobs to selenium* jobs
selenium* jobs are a new way of running Ruby based Selenium tests. The
jobs are triggered daily.
Bug: T128190
Change-Id: If240d2da8f0c55ed46f1f2f34c6aca05bcba09ac
2016-04-25 17:54:45 +02:00