Previously, there were a couple of hacks in play.
It was also not picking up ~~~ (signature without timestamp)
And it relied an a nasty regular expression which, although
based on Parser, may some day get out of date.
And it relied heavily on a specific signature format, which
isn't guaranteed (it's an i18n msg)
This patch changes the approach: it will use a very simple
regex to match links, and will send those through Parser to
generate the signature anew. My reasoning is that that should
be exactly the same as what Echo just received (should've
also gone through parser)
Biggest discomfort of this approach is that it's much stricter.
It should still match whatever it generated from a ~~~ or ~~~~,
but no longer the e.g. not-real signatures we were doing in
our tests. Also had to update our tests, because signatures
change depending on anon. So I had to generate all the users.
And fix some of the signature formats used in the tests.
Bug: T75426
Bug: T87852
Bug: T75366
Bug: T78424
Change-Id: Ibeff36397129fdd5d376f3668a23a45f9a014525
In some languages the \w+ does not match the characters used
when translating UTC and the regular expression attempting to
match the timezone fails. Testing in prod wikis where this fails
such as ne.wikipedia.org shows it still works, it just generates
a more generic regular expression.
Since the overall process still works acceptably on the wikis outputting
warnings this patch just adds a guard to prevent the warning and does
not attempt to fix the underlying issue.
Bug: T76558
Change-Id: If8e1ddd2d642b042cc24c51d5ba5aa8b34bc9552
There were two different circumstances that could trigger echo's signature
detection to fail: multibyte characters in signature, and signatures near
$wgMaxSigChars limit that expanded past the limit due to wfEscapeWikiText().
This patch adjusts to use mb_substr to appropriatly handle the multibyte
characters, and adds a couple extra charactesr to $wgMaxSigChars to allow
for wfEscapeWikiText(). This isn't perfect, but a stricter implementation
would require much more work than i think we should spend here.
Bug: 73426
Change-Id: Ic51c2bc2a08600f188db13a9a0537f1321c9a655
Previously this was loading 25 unread notifications. If less than 25 were
found it would add in 3 read notifications so it wasn't empty.
This patch changes things around to always return 25 notifications if the
user has at least that many. Instead of backfilling a static count of 3
we backfill 25 - $count with previously read notifications.
Change-Id: I723316486216d7b9dacfcc9765c1a8212e973518
Currently echo attempts to find a signature by looking for a series of
strings starting with what it thinks are the current aliases of NS_USER
and NS_USER_TALK. This has shown to be error prone, see the linked bug
for how a change to ru.wikipedia.org/wiki/Mediawiki:Signature broke
mention notifications.
Patch switches things arround to pull wikilinks out of the text and run
them through the Title class. The results of this parsing are checked
for NS_USER and NS_USER_TALK, giving a much stronger guarantee of finding
translated namespaces.
Bug: 71353
Change-Id: Ib0d0f4e068339d2fd28761087c05f5a1acb3c1fc
Has a performance impact, so this depends on deploying the job
that deletes older notifications.
Bug: 69919
Change-Id: Ia485c853d1b04c3c85e25e6a12f5060a046e9b11
The only issue is that the badge is not up to date till
you refresh the page, I think that's fine for now
Change-Id: I585b4cc185bf859ddb06829df75309ff3d56d8b8
* cache function result in local variables
* Update the logic of generating notification date header
Change-Id: I04c3ed853076f17c819da8f27bfdb169e99b2a3a
Core titleCache doesn't do what I expect it to do, issuing
Title::newFromId( 1 ) mulitple times would issue multiple
idential queries to the database. It doesn't return what's
already in the cache.
The goal of this patch is to batch load titles via newFromIDs,
and save the number of mysql queries
Change-Id: I8fe767ac2669e67bdf7d17eecccfc0dcb6b5fc7d
The new locateUsersWatchingTitle implementation could end up returning
thousands of users, currently on enwiki there are 25 titles with more
than 10k subscribed users and aprox 550 titles with more than 1k subscribed
users.
This switches the user collection to an iterator based implementation so that
we no longer need to have the entire users list at any one time.
Change-Id: I3d3fa9328f348bb48682d3658622952ce82d3925
The special page will now not auto mark a notification as read if
it has a target url. Currently no notifications have target urls
but this will be changed in a later patch...
Change-Id: I9bd71d59391189d5d761ab5f1c84af0bc3554be0
* This will be used for the unread notifications in message overlay
* This will be used to "mark all as read" based on sections ( event types ),
since we can't do updateJoin. We could set a max update limit like 3000,
and use this to do "mark all as read", this would handle majority "mark all as read"
use cases. This would also prevent updating big amount of data on a web request
Change-Id: I2a9103a73d0aa91a52d5c0233e946a0ef979f96d
This will be used for marking a notificaiton as read when
a user visits a target page. The new table should keep the
volume as low as possible for fast data loopup. records
should be removed from the table once it's marked as read.
Change-Id: I605cbc79adfc12d22bd889c5bb513d05c479fe6e
* Shared function can be put in the abstract class and this also enforces some interface methods
* Initialize a default dbFactory when it's not passed to the mapper
Change-Id: I1033dafaa90a1f683fbe9ad69bed04f4844e357b
Replace implementation specific code with generalized user-locator
implementations that can be re-used by more notifications in other
extensions.
This patch adjusts the `user-locators` notification parameter to allow
arrays which facilitate passing options to the locator.
Previously(still works):
'user-locators' => array( 'foo', 'bar' ),
New functionality:
'user-locators' => array(
'foo',
array( 'bar', 42 )
)
In the second example the callback specified by `bar` will receive
an EchoEvent as the first argument and array( 42 ) as its second
argument.
Change-Id: I7305279bc91d1e40e7054e2fd42a819a35526b82