It's basically impossible for DatabaseBase::select() to return false now
that ignoreErrors() is protected. So always return an array so callers
don't have to worry about false.
And remove a test that checked the result if DatabaseBase::select() did
return false.
Change-Id: I9ca8511585403d8c0ec262898ad4e61c2b038d51
Although it wasn't here even before
c94c3f3dad , loadFromRow will make
use if it if it's present. Otherwise, it's the current timestamp
(which seems odd; if we really don't need the timestamp in a
particular scenario, null would be more straightforward).
This is also public (getTimestamp()).
Change-Id: I9d88d86dde5b7f9b5965c81225a2aab4354c2baa
Follow-up I6c956738, which started trying to pull notification_timestamp out
of nowhere. Although EchoEvent::newFromRow may try to use this if it's set, it
wasn't previously getting selected and this is now causing exceptions.
Bug: T105890
Change-Id: I2dd9e268428d651813d8c43d85d54fc97634cd41
As needed by EchoEvent::loadFromRow().
Alternatively, just '*' as in MWEchoEmailBatch::getEvents().
Bug: T105890
Change-Id: I6c956738125658607d5e548efad4031c3298020f
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
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
Has a performance impact, so this depends on deploying the job
that deletes older notifications.
Bug: 69919
Change-Id: Ia485c853d1b04c3c85e25e6a12f5060a046e9b11
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 was supposed to merge master into the two_tabs branch, but it was accidently done against master instead
This reverts commit 06ee936e92.
Change-Id: I98da735b7d5c103399a2478286d1420243df6ba4
* 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
* Get rid of EchoBackend by separating responsibilities into smaller objects
* Move main fetchNotification logic from API to a more appropriate place
* Add more unit testing coverage
Change-Id: I42f4d7566543332588431c21c220c0d64d026b70