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
I tried to stick as close to the existing code as possible.
Special:Notifications is slightly different from the overlay,
however. I made it add .mw-echo-unread class for consistency,
but that JS doesn't record seen time (it only loads older
entries), not does the CSS fadeout apply there (it marks
everything as read as soon as it's displayed, so different
behavior from overlay)
PS: I'm not sure about browser compat for the fadeout. But
even if some obscure browsers don't support this, meh. It's
not an "important" feature that can't be missed.
Bug: T94634
Change-Id: Ibb201823fb52ef8a3d5eaa39b0b724ede8d271d1
Style modules currently added through addModuleStyles default
to being in the head ("top" position). This is an unhealthy default,
since only critical styles that are needed at pageload should be
in the head. In order to be able to switch the default to "bottom",
existing module positions have to be defined explicitly.
Bug: T97410
Change-Id: Id972c96526a32dc4ca332e973f6bd752601c2d5f
Link the bottom of the talk page and use the edit summary as text
if the parser failed to find something. This is what core's enotif
does already.
Change-Id: Iadc7011ea2627e00f0c51472da7aad1355afeddb
The default value is never used, it is overridden in the constructor.
Having it here just misleads someone looking at the code to think it
might pull all columns by default.
Change-Id: I0e743c371d4bd2fab5b89740ba1e0f082512ec34