Commit graph

241 commits

Author SHA1 Message Date
Kunal Mehta c99a93dd5c thank-you-edit: Cast counts as integers before comparing
Because somehow we're ending up with 100 !== 100 in the logs.

Change-Id: I9c24b5dca3fea7d52fc0e0a52e53702385eb0fb1
2016-03-11 11:30:15 -08:00
Matthew Flaschen 07c962e82f thank-you-edit: canRender for deleted page and extra fix
Don't try to render if page was deleted, and fix 'extra' parameter
(was breaking message key and thus rendering)

Bug: T129641
Change-Id: I5d0fdfd3921427993211969eb5793f8e9e7667a8
2016-03-11 13:59:27 -05:00
Kunal Mehta 26a8bc2450 Defer onPersonalUrls() DB writes to post-send (try #2)
This reverts commit e372f3ce6f.

The previous attempt was broken because
EchoTargetPageMapper::fetchByUserPageId() returns a list of
EchoTargetPage objects, not a single one.

Bug: T117531
Change-Id: Id02a025e3736a7b92d9d6fb8adf29ef674f8e2fa
2016-03-09 11:07:50 -08:00
Kunal Mehta 51dd4fd109 thank-you-edit: Only call User::getEditCount() once
And rename $editCount to $thresholdCount for clarity.

Change-Id: I115b2dfabf472c855c186d05fa4e31aa7c9c3d6c
2016-03-08 17:05:05 -08:00
jenkins-bot acdcb5c895 Merge "Revert "Defer onPersonalUrls() DB writes to post-send"" 2016-03-09 00:11:50 +00:00
Catrope e372f3ce6f Revert "Defer onPersonalUrls() DB writes to post-send"
Causes fatals in production for some reason.

This reverts commit 93387806c2.

Bug: T129299
Change-Id: Ie90aa493e2940fae9d6f380b95f87a4cc7e04622
2016-03-09 00:00:11 +00:00
Roan Kattouw e85c3832bb Add debug logging for when the thank-you-edit code detects a race condition
We seem to be discarding *all* thank-you-edit notifications as
race conditions now.

Bug: T128249
Change-Id: I1f284bd13e89fe2205c4c87a6c0f4a7dfe1c8bd1
2016-03-08 12:04:45 -08:00
Aaron Schulz 93387806c2 Defer onPersonalUrls() DB writes to post-send
We calculate how many messages and alerts are being marked as read, and
subtract them from the count since the database and caches won't be
updated until the end of the request.

For performance, we also get the event_type while doing the
EchoTargetPage lookup query to avoid having to query it individually
later on.

Bug: T117531
Change-Id: I0d9302adf1b4b07a4ff26a04b00d4498aa3fe7ee
2016-03-08 01:41:52 +00:00
Kunal Mehta 8d99490108 Try and avoid race conditions with thank-you-edit notifications
Wait until after the main transaction has been committed before checking
whether they have the right number of edits.

Bug: T128249
Change-Id: I38cc0f96e97fda3692340cc8906144a002594ef2
2016-03-03 21:48:01 -08:00
Stephane Bisson eb873aaa60 Include cross-wiki notifications in unread count
* Client-side only. The backend already counts those.

Bug: T124109
Change-Id: I62e49524bc8cea1ef2d77255e29ff8a919bd1ee7
2016-02-29 16:02:05 -05:00
Kunal Mehta 3a29b1112f Add some debug logging to thank-you-edit notifications
Bug: T128249
Change-Id: I074cfa51e1d45a6dcc5a1316ef4e83e20319f8a6
2016-02-28 22:13:25 -08:00
James D. Forrester 23ebee2a61 Provide three more edit threshold congratulatory notifications
Change-Id: Icd213fe7dd7ab8451432d35d6ee289c49449d5d1
2016-02-26 15:51:25 -08:00
jenkins-bot e0b5d8c397 Merge "Don't process null edits (or other warnings in article save process)" 2016-02-24 21:39:36 +00:00
Stephane Bisson bbef0c15b4 Remove footer from email notification excerpt
Bug: T127098
Change-Id: I7de634ddcde65cb006afc18e95d83229ecbda6c1
2016-02-24 07:48:38 -05:00
Matthias Mullie e22675c880 Don't process null edits (or other warnings in article save process)
Bug: T123843
Change-Id: I5ce4deb2ad71ae6355fae31bbce68dc147aa0137
2016-02-24 09:27:18 +01:00
Kunal Mehta 7fbec72803 Always show the messages flyout icon
Bug: T127731
Bug: T124372
Change-Id: Ie97229b7ef34cd807f16c76ceae0682c425c53b4
2016-02-23 01:21:28 -08:00
Stephane Bisson dff7e8072b Include reason in user-rights notification body
Bug: T126277
Depends-On: Ib9bb28a7a77602e3e729fd0bf13ab8259e15b006
Change-Id: I4941c4ba16ee95798767d858792090609b47b4e4
2016-02-16 01:51:07 +00:00
jenkins-bot 5019802f29 Merge "Introduce congratulatory notifications for reaching edit thresholds" 2016-02-12 22:19:04 +00:00
James D. Forrester 5031539327 Introduce congratulatory notifications for reaching edit thresholds
Bug: T124003
Change-Id: I21c6570e178fd03d969a516bdb31a6da9735d242
2016-02-12 14:11:21 -08:00
Stephane Bisson 09928f1ed2 Add email body preview to emailuser notification
when the subject line is left with the default
generated value, we take the begining of the
email content to add a preview in the
notification.

Bug: T121831
Change-Id: Ib7c646f6709c7100ef51186f84fe14807d6a211a
2016-02-12 14:50:17 -05:00
jenkins-bot f0ca5a5f0d Merge "If user only has foreign messages, the messages badge should not be suppressed" 2016-02-10 21:02:15 +00:00
Stephane Bisson 442f812774 Add subject to email notification body
Bug: T121831
Change-Id: Ib1a9212202d2c84de8d968d043f65e24b2d94fae
2016-02-10 12:34:26 -05:00
Matthias Mullie b9f2d026a6 If user only has foreign messages, the messages badge should not be suppressed
Bug: T124372
Change-Id: Id9699c56e9b8c6af77e74cbfc48b6e4e3464b3a5
2016-02-10 13:25:50 +01:00
jenkins-bot 18bffba313 Merge "Display revert edit summary in revert notification body" 2016-01-18 19:46:49 +00:00
Stephane Bisson d7d70a06a1 Display revert edit summary in revert notification body
Only display when it's different than the pre-populated
edit summary (Undo revision 123 by User).

Bug: T121808
Change-Id: I5a00ff174fd31fdbf776a06b7b9375f63b921677
2016-01-18 10:14:15 -05:00
Roan Kattouw 4548917278 Update info and discussion links for beta feature
Change-Id: Id3badc50d9e86a39c2da448e454c5f30716539ad
2016-01-15 13:51:40 -08:00
jenkins-bot 5670a247f0 Merge "Add cross-wiki as a beta feature" 2016-01-13 09:01:04 +00:00
Moriel Schottlender 386fb0e8b4 Add cross-wiki as a beta feature
This commit only adds the beta feature parameters and preference.
The API will need to check whether the feature is enabled.

The beta feature option is behind a feature flag
$wgEchoUseCrossWikiBetaFeature, that must be set to true for
the beta feature to appear on the wiki.

Bug: T114237
Change-Id: I61e1bd62571e55f7f685f64e0c37e7702875e407
2016-01-13 00:54:17 -08:00
Justin Du 889dcc6584 Use the double speech bubble icon in the Messages panel
Bug: T119377
Change-Id: Icc7d751ef307fab9f8914728aac229fa28f1a860
2015-12-16 18:02:48 -06:00
mhutti1 ea64fe4770 Redirect anonymous user to login page from Special:Notifications
Added code to redirect the user and display a short message informing
them of the need to login.

Bug: T118873
Change-Id: I2145bc1502dbd19d660302d9f19e0d4a2ad5ad50
2015-12-08 11:55:15 -08:00
Kunal Mehta 0790125dd4 Don't export unused wgEchoOverlayConfiguration/wgEchoHelpPage JS variables
And make the if conditional a little easier to read: is logged in versus
not anonymous.

Change-Id: I76784b74caabd1ea0a5f0f506661a1682c865394
2015-11-12 10:42:54 -08:00
Kunal Mehta 20be6beb7c Fix page-linked notifications
This hook is now executed through the job queue, so $wgUser will not
accurately be set.

This depends upon I083736a174b6 in MediaWiki core to actually work.

Bug: T116485
Change-Id: I176fec492d136b097ada79a308e6822832705472
2015-10-27 16:17:25 -07:00
Edward Chernenko 5189fc0ff2 Support UserMerge into anonymous user
When UserMerge is used to merge an account into anonymous user,
we shouldn't attempt to operate on MWEchoNotifUser for $newUser,
as it would cause an exception.

Change-Id: I726e6115d2c30e1579dae55e57cc800aa61d9d7c
2015-10-12 18:34:01 +03:00
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00
Kunal Mehta b1cbcb32a0 Remove duplicate 'MediaWiki' prefix from echo.unseen stats
Caused metrics to be reported as 'MediaWiki.MediaWiki.echo.unseen'

Change-Id: Ie141b896d0574b081a362b06043d842c2a897df0
2015-09-22 17:46:22 -07:00
jenkins-bot 3c43555c55 Merge "Use UserGroupsChanged hook instead of deprecated UserRights hook" 2015-09-22 18:24:40 +00:00
Kunal Mehta 073ade0a77 Use UserGroupsChanged hook instead of deprecated UserRights hook
Bug: T113357
Change-Id: If63b08493bcd49be9608d20a0d6fee0b3b205d58
2015-09-22 11:16:59 -07:00
umherirrender 07761b632e Add an emailuser web notification
When an user sent an email to another user with [[Special:Emailuser]] or
action=emailuser, give an echo for the target user to be lookup in his
mailbox.
This option is off by default. It is only useful as web notification,
because an email notification would go to the same address.

Bug: T56130
Change-Id: Ie279457daf51e1c34c998197ce9e76c78ee705e4
2015-09-22 01:58:17 +02:00
Kunal Mehta b539621b7f Split up ext.echo.nojs into badge and notifications styles
And rename "nojs" to "styles". It was supposed to mean base styles that
are used by no-JavaScript and JavaScript mode, but it confused people.
Hopefully "styles" is clearer.

Change-Id: Ie8d668fb0d95a9162392c5fa7c3200bcacef1025
2015-09-16 12:52:12 -07:00
Kunal Mehta 31c770741a Don't depend upon ext.echo.logger in ext.echo.init
The logger code for clicktracking is only needed after something has
been clicked, so we don't need it in init.

* Move EventLogging initialization into Logger.js
* Add ext.eventLogging dependency server-side if needed

Change-Id: I46ff3c62b05c24dd2bb18a1574df17f9d2823125
2015-09-16 12:52:07 -07:00
Kunal Mehta c726c1ecab Measure how likely users open flyout if they have unseen notifications
If users are likely to open the flyout whenever they have unseen
notifications, we should preload some more resources to make those
intial openings faster instead of lazy-loading everything.

On the server-side, we will increment the MediaWiki.echo.unseen metric
whenever we serve a page when the user has unseen notifications. Then on
the client we will increment MediaWiki.echo.unseen.click if they opened
the flyout while having unseen notifications.
By comparing the two graphs, we can determine how likely users are to
click on the flyout whenever they have unread notifications, and how
useful preloading extra resources will be.

Change-Id: I14e9aa7f03d6ef275042b8a2c4cb0e5b5a64c0d7
2015-09-16 10:18:17 -07:00
jenkins-bot 1d9481f43c Merge "Only load ext.echo.ui if the user clicks the echo badge" 2015-09-16 17:14:51 +00:00
Kunal Mehta 9e75474b5f Split out .mw-echo-alert styles back into a separate module
Change-Id: Ia946eb3b7cd917f84b7ab57a280f55a3eadfcebf
2015-09-16 17:02:22 +00:00
Moriel Schottlender c5905962ab Only load ext.echo.ui if the user clicks the echo badge
There is no need to load the entire of Echo's ui module (especially
since that includes ooui widgets and their styles) on every page load.
There's only need to load the entire module if and when a user clicks
the Echo notification badge.

Also, make the echo.dm model accept an external fetchNotifications
promise so we can send the API request alongside loading the echo UI
and "feed" it into the DM for processing.

CSS adjusted to make the "jump" between the nojs and the js buttons
seem less jumpy.

Bug: T112401
Change-Id: I516e655ffd198511d694489a0702c5c713a5fd68
2015-09-15 17:11:46 -07:00
jenkins-bot 6c298f9145 Merge "Don't show orange alert if you are viewing your user talk page" 2015-09-15 23:01:26 +00:00
Kunal Mehta e4d8002d74 Don't show orange alert if you are viewing your user talk page
We cannot count on the user_newtalk flag being cleared since that
happens in a deferred update.

Bug: T107655
Change-Id: Ie954ed7c5a4e784c3feb86288943a56cfb9c23c0
2015-09-15 08:50:48 -07:00
Roan Kattouw f2ed7a6a53 Don't load unused Echo JS/CSS on mobile
MobileFrontend has its own implementation of the notifications
flyout, so don't load any of Echo's code. We do still need
ext.echo.nojs on Special:Notifications though.

Bug: T112571
Change-Id: If4d84810070ccd48a8007a3ff80733a7db30fdb3
2015-09-14 23:12:59 +02:00
Roan Kattouw 5b1fc2b818 Hack around OOUI's icon pack being too large by creating our own
Bug: T112401
Change-Id: Id2a527dc1f4846985beb2cc4d5562a27d5636d55
2015-09-14 22:21:45 +02:00
Roan Kattouw b046a1062d Don't load oojs-ui.styles on every page
We don't really need it to render the no-JS version
of the notification badges (the only rule we were missing
was background-repeat: no-repeat;) and it significantly
increased the amount of render-blocking CSS.

This means we do need to call setupOOUI() ourselves
in order for our get_class( OOUI\Theme::singleton() ) hack
to keep working.

Bug: T112401
Change-Id: I148f8ac19dfe62cc84abe03e1a2ff00683d515c1
2015-09-14 12:38:44 +02:00
Kunal Mehta 957c2b0c98 Only use inverted icons for skins using the MediaWiki OOUI theme
Otherwise it causes flashes due to colors changing in skins that don't
use it, like MonoBook

Bug: T111821
Change-Id: I03acdbcbfa3912b439a18187d52944931e94506a
2015-09-10 10:22:37 -07:00