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
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
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
The step formerly know as "I come back from grabbing a cup of coffee"
is replaced by a step that reloads the page a number of times, where
that number may be set by the user. If the notification has arrived,
the polling stops and the test continues.
In practice with a local browser pointed to beta labs, the
notification is arriving in plenty of time for the first page load
and I do not see the page reloading at all.
Change-Id: I95dd77d4f5525645e46244e40bfcd86e9124f3b1
Cucumber Scenario and Feature description are just plain text.
Instead of using comments, it is far better to describe in each
test step what should happen in each test step.
I believe I have described these test steps correctly. Please
advise if they need to be tweaked.
(The test itself seems to be fine, but feel free to review that
also)
Finally, since messages.feature uses the "I have no new notifications"
step, I updated those assertions for modern RSpec syntax
Change-Id: Ie884a85c1fc3f7045773a271a8d76fad6b0b3826
"Then" steps should always contains RSpec assertions. In the
past this meant using some version of the word "should", but
the modern convention in RSpec is to use "expect()" as I
did here.
Change-Id: I1c438a310803e29c0985328a76d2ec08578e0cb0
* add @custom_browser tag so we don't create an extra browser instance
* remove @chrome tag because this only works in Firefox
* alphabetize within G/W/T buckets in commons_steps.rb
* alphabetize flyout_steps.rb
* bring env.rb up to date with the modern situation
* make assertions about the URL and heading on the final destination page
* update Ruby gems, especially mediawiki-selenium with a @custom_browser improvement
** use modern RSpec assert syntax
*** we're going to have to update all the repos for this soon
Change-Id: I6cb20126a662bd2a20e2b4bbebe91e8f3b04c7df
* use symbols not strings for element labels
* use double quotes except where single quotes required
Change-Id: I4eef50206c526611da535e529035c076d5bce266
I did `bundle update`.
Without this, browser tests on Firefox 32 fail with
`unable to obtain stable firefox connection in 60 seconds
(127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)`
Change I26190cca06ee gave Flow the same update, this Gemfile.lock is
identical except Echo has a "chunky_png" gem.
Change-Id: I0b62134d38f3262b734af83cc58b644040857645
Echo browser tests pass, but are skipping
Scenario: New user gets a sign up notification
because a step definition is missing.
I simply adapted
^I am logged in as a new user with no notifications$
and the scenario passes in chrome.
Change-Id: I9f2bd10d05b689eaacbf2890913786eb157d6af9
This reverts the tests and amends them after the
application of commit 5da9eac08a.
Luckily nothing appears to be broken.
Change-Id: I67acfe5dc74ef750d5443dd619dbb114623ee233
The only exception is when there are new message notifications but no new
alert notifications.
Bug: 70461
Change-Id: I06daa3f7d526beeb878eb343c169e01acd49e71f
Notification timestamp is generated in MW format (YYYYMMDDHHMMSS)
inside the model and saved to the database in db specific format,
We need to convert it back to MW format when loading the data
from the database, it just happens that MW format is the same
as MySQL timestamp format
Change-Id: Ie881b66c8c24d57a8933c0153e9e7db5fe6aa017
* Moved most of the content from notify to getEventNotifyTypes
* Added phpunit test verifying per-event config overrides defaults
* Remove special-snowflake welcome handling with proper configuration
Change-Id: Ic1aae11d37f23f2b7b8abe3c1edaa414e29be021
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