The Echo cohort study was finished in July 2013 and hasn't been used
since. The code was also checking in reverse order, for example it
checked registration before checking whether the survey was still
active.
EchoHooks::isEchoDisabled() was removed, and all callers were checked to
make sure they were also checking for anonymity.
EchoNotificationController::doNotification() will throw an exception if
the user is anonymous, since it shouldn't be possible to get an
anonymous user into that code path.
Bug: T101047
Change-Id: Iada2f6d2066c0f6bba5cc58aeb03d687632ac5a4
All uses of $wgEchoBackendName were hardcoded to 'Db' and removed.
This exposed a interesting bug in MWEchoEmailBundler which was
instantiating a subclass using the parent class's private constructor, a
"feature" of PHP which is supported in 5.2.6+ (http://3v4l.org/h4Mq3).
While it worked, PHPStorm complained about it so I made the constructor
protected, which makes more sense anyways.
Both EmailBatch and EmailBundler need further refactoring, but that will
be done in follow up patches.
Change-Id: I2032f5b2f4f3a62f830cc5344b25a92074bd0c61
Let EventLogging register the schema modules by using the
EventLoggingRegisterSchemas hook.
Don't modify $wgResourceModules at run time because that's a hack.
Instead register the module in the ResourceLoaderRegisterModules hook
itself.
Change-Id: I9457546c1ec38cf6896fe6f9f445fe1191afe72a
Like CentralAuth does in createLocalAccount.php. In large wiki clusters where
you want Echo on for some wikis and not others, but don't want to keep a list
of Echo wikis (say, you want to make it on by default), this makes it possible
to safely run the script even on wikis where Echo is not enabled, where it will
just do nothing.
See also Ibde4c0c1, I741d2485
Bug: T59375
Change-Id: I3537206fccb459eb80de9fd61d2213dfb525c5f0
Update the "processEchoEmailBatch" to allow sending all
notifications immediately even if configured to be
daily or weekly.
Change-Id: I6ebeea86708247700d1950e0f6471c7b3d1fecd2
getNotificationCount & getLastUnreadNotificationTime have an
argument $cached that allows cache to be bypassed & read from
DB. That result is then stored to cache.
In practice, it seems to be used only for cache invalidation.
getLastUnreadNotificationTime didn't allow to specify the DB
to be read from, and EchoNotificationMapper::fetchUnreadByUser
only read from slave.
So when we wanted to invalidate the cache, we would end up
immediately repopulating it with data from a (potentially and
likely) lagging slave.
I've made it accept the DB type, similar to getNotificationCount.
Bug: T98421
Change-Id: Ie4b09eeb04b9827b454cb2d92ee8c674bdd59a19
Since we didn't use to save seen time, it is unreliable at first.
I decided to just show them as read then, since we couldn't know
if they had or hadn't been read.
However, it would make more sense to keep them unread until we first
save the time a notifiation is seen: it is in line with the current
behavior (where the badge just stays red, always)
Also fixed a problem where I meant to .get a value but had .set
instead. It wasn't noticable because that function is currently
only called when things have just been seen, so even though it
was wrong, it produced a good result.
Bug: T94634
Change-Id: I7ee447249527feb3914c76cfffd673bbda062b75
Removed exemptions from .jscsrc and fixed the code to make jscs still
pass.
Kept the dangling underscores exemption because leading underscores
are (for now) used as a naming convention for private functions in
this repo.
Change-Id: I18964f8469f52c294276527d92cb6bf9f48c2576
* Update package.json based on Flow's
* Add Gruntfile.js based on Flow's
* Add .csslintrc and .jscsrc with rules to silence errors for now
Change-Id: Ia8e23537d8dccbcff9ee336f667dc463590c0235