Instead of returning false when no links in the user namespace are
found, return an empty array. They're both falsey, but this way we don't
break the type hint in generateMentionEvents(), which is the only thing
that getUserLinks() is used for anyway.
Bug: T239275
Change-Id: I93b320be07cfdae68c5e296b2caa62ea4fae5ff2
Now that seen times are TTL'ed, there is little sense/incentive to set
them in the cache to the default value, since we assume the default
value if they're not in cache (which is being set here). Therefore,
setting them only increases the cache size without any gains.
Bug: T222851
Change-Id: I78a0045e4a53653196114da81c2d60328e78c269
These entries weren't TTLed at all, and so we had millions of records
for inactive users that were being stored forever. If a user doesn't
view their notifications for a year, it's OK for their notifications
badge to go back to the unseen state until they click it.
(The fallback behavior on a cache miss is to act as if the seentime is
the UNIX epoch, which means that any unread notification they have is
more recent than it, and is considered unseen.)
Bug: T222851
Change-Id: I99230d2351b40751a3f2f5123c5f38693120259e
Defaults to MainStash, but can be configured to use a different cache
backend by setting $wgEchoSeenTimeCacheType to a string that keys into
$wgObjectCaches.
Bug: T222851
Change-Id: Ifb935cc8be4618f7794ee79a234fc66d5cc5728a
This code will be enabled when Iba1d7863171268066bf7597182c57a0a2041497f
relinquishes the responsibility for rendering the Echo notification badge
and wiring up of the related JS.
It makes 3 assumptions:
1) Minerva will expose a VERSION property on the skins.minerva.scripts module
to tell Echo it can begin control of the functionality
2) A new hook `SkinMinervaReplaceNotificationsBadge` will run on the server side
allowing Echo extension to render the Notifications badge in Minerva.
3) A new client side hook (echo.mobile) will fire whenever the Echo dialog is opened or
closed.
All code relating to Echo inside MobileFrontend and Minerva is
moved here.
CSS for the modules is kept in Minerva as skinStyles
This code remains dormant until Iba1d7863171268066bf7597182c57a0a2041497f lands.
It pre-registers a "to-be-created" hook SkinMinervaReplaceNotificationsBadge that
substitutes the Minerva badge.
It also watches the export value of skins.minerva.scripts for a VERSION value - when
this appears it will take the signal that it should manage the frontend code.
In the new system the mobile specific code is limited to the mobile version of
Minerva. The desktop version of Echo loads on Minerva desktop - presenting an
opportunity in future to consolidate both implementations to use the same component.
The mobile version of Vector and Timeless for example will load the mobile overlay
(with existing styling issues that we don't need to worry about right now given
we don't officially support skins other than Minerva as mobile)
Testers:
* Check require( 'ext.echo.mobile' )(); inside initMobile
inside ext.echo.init does not fire until
Iba1d7863171268066bf7597182c57a0a2041497f is checked out.
Depends-On: I1a66939d2b596094b419de40b370e79f09c85581
Bug: T221007
Change-Id: I09c27a084100b223662f84de6cbe01bebe1fe774
Update usages of the variable for the capitalization difference.
Depends-On: I4d289267991f1f9a8e0710ec6ee5a2131306c510
Change-Id: Ie49e898b33765aa0723501be8c0c30622e7cbd2f
As noted in Ic22075bb5e, UserNotificationGatewayTest relies on the presence of
globals. When Ic22075bb5e is merged, UserNotificationGatewayTest will fail in
CI. This patch injects the configuration object into UserNotificationGateway.
Change-Id: I9c15a588a76a41a3ebfb59dac7f0761f756008ff
New preference added so that user can set
* Displaying (n) total unread count in the title
* Displaying notification snippet for incoming notification
Bug: T229732
Change-Id: I35eb68dedf1e087b4668bfec404935f1244b3d0b
There's no real reason for these to be in MakeGlobalVariablesScript
because they don't really depend on the request context: they were being
omitted if the user was not logged in, but we can just check the user's
logged-in status in JS instead.
Bug: T221151
Change-Id: I2df6d7e061545d342bc3068dccd5ce2f6e85fe78
Remove wgEchoMaxNotificationCount and wgEchoPollForUpdates from the
startup module and put them in the ext.echo.init module.
Change-Id: I03f9a3953aa97ead1a29c13a992a02404a6d0b68
The hook (SpecialMuteModifyFormFields) is used to append
the option to mute/unmute echo notifications from a specified user.
Special:Mute handles posting and saving the fields, the only
requirement is that the field name is the same as the property
that wants to be modified, in this case 'echo-notifications-blacklist'
Bug: T220163
Depends-On: I2b3eee0802cb086091f35ecce13ae77a8e7d518d
Change-Id: I77b3ccfdce9b501eb8ecd58c0d7bbecb78029a7e
RevisionRecord::getComment() can return null. When it does, accessing
->text on it fails.
Bug: T226681
Change-Id: I069cd5d5bef51a3e2b8f4e7b50d478cf47f65e00
* MVC is used to change the count of notifications on header icons.
* The Widgets are loaded after 60secs or icon click, whichever occurs first.
Bug: T219222
Change-Id: I2d034a76d5c3abe55894dd1dd10e28713344c5bb
PHP doesn't care much about the name (in terms of case sensitivity)
but I think we should make sure the names of the method should be as
they're in their definition.
Change-Id: I6e38d8be64efaec4200471f2d3007275d7ddecec
Now that OOUI's "alerts" icon pack includes all the icons we need, we can use it and get rid of the badgeicons module.
Bug: T139779
Change-Id: I8218530ed2cdd2d81c1fc24509f36ea2b6742bd9
Follow-up Icfc8516 and I3d997f9 (migrating from deprecated Revision
to RevisionRecord)
When generating 'edit-user-talk' events, if we don't have the section-text,
we use the edit summary instead.
Revision->getComment() returns a string but RevisionRecord->getComment()
returns a CommentStoreComment. As a result of the migration, an instance
of CommentStoreComment was put into the event 'extra_data' and later
added as a plain text params during notification presentation.
This patch proposes to
1) Make sure to add the comment's TEXT to the event
2) Test that the 'section-text' is a string before using it
as a message parameter. This will cause faulty notifications to
render without a body instead of erroring out. We could write a
maintenance script to fix those notifications but I don't
think it's worth it.
Bug: T223741
Change-Id: Ie3a1c59a43b0981ec42fc77e7ebb0e8bd132dbe2
This reverts commit 13956265c1.
The Wikimedia CI jobs running phan were installing mediawiki development
dependencies which might overlap with the dependencies from the
extension. Ultimately phan failed with:
includes/RemoteSchema.php:9
PhanRedefinedInheritedInterface
\RemoteSchema inherits abstract Interface \JsonSerializable declared at
internal:0 which is also declared at
../../vendor/jakub-onderka/php-parallel-lint/src/JsonSerializable.php:4.
This may lead to confusing errors.
If7171a6d46473b0bb05e3adaeb40229e7881c2b6 adjusts the CI configuration
to no more install MediaWiki core development dependencies and solely
relies on mediawiki/vendor.git. That prevents the duplicate interface
definition.
Bug: T223397
Depends-On: If7171a6d46473b0bb05e3adaeb40229e7881c2b6
Change-Id: I794fbffe59104f138802bc6ded1a9d9a58ba9437
Follow up on Icfc85167a636bef95daab2.
Bug: T221163
Depends-On: I31d819f4453032da8deb117254b954fba058e0a3
Change-Id: I3d997f9e8d4bd1566ec6fd8fe2d33be5161458b3
To my knowledge in all the places I'm touching in this patch the new
code is functionally identical to the old one.
Change-Id: I0ffa96d2f9cb9bf932f68b689244051c96c17ad9
Class Revision is deprecated and in this patch, replaces
usage with appropriate classes; RevisionRecord, RevisionStore,
etc.
Bug: T221163
Change-Id: Icfc85167a636bef95daab236ab80113c1a3cf41b
When creating the various notification sources,
the server was indexing them with wfWikiID() but
the client was using wgDBname to find which one
is local and which are remote. On some wikis,
like TWN, wfWikiID() includes a db suffix so
the JS app on Special:Notifications is failing to
find the local source and errors.
Bug: T167336
Change-Id: Id60f723b615fb7db54a6f17b1c1be20dfe98e36c
When deleting echo_notification or echo_email_batch rows, also delete
the corresponding echo_event rows if no other echo_notification rows
or echo_email_batch rows refer to them.
Bug: T221262
Change-Id: I416ff107bd000a0cfac102408c993f8bec2d0286