Page MenuHomePhabricator

Unread notification count is wrong when presentationModel::canRender() returns false
Open, LowPublic

Description

presentationModel::canRender() can be used to suppress notifications about pages or users that have been deleted. The unread notifications count doesn't take these into account. The badge shows up with a number but when the panel expands it does not contain the new notifications that have been suppressed.

Event Timeline

SBisson raised the priority of this task from to Needs Triage.
SBisson updated the task description. (Show Details)
SBisson added a subscriber: SBisson.

I'm not sure we want to do something about this: getting the raw number from DB is fast; looping all of them just to validate the number will be expensive (especially for cross-wiki notifications)

Implementations should just make sure not to create notifications that can not be displayed. Maybe on insert time, we should already run the notifications through canRender once, just to make sure we can actually store the notifications. We could then still have edge cases where some conditions have changed a week later and the notification can't be displayed (e.g. page suppressed), but then those will just be that: edge cases.