Browser notices: a tab is handed notices older than the one-week limit #577
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#577
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading the in-tab inbox of the browser notifier.Checked again on 2026-10-01 against
mainat0a5cad587: still present.A browser notice nobody collects is meant to be thrown away after
KEPT_FOR(a week), but old notices are deleted only when a new notice is left for the same person.collecthas no age filter, so a person who is sent nothing else meets a stale notice, possibly weeks old, as a fresh desktop notification the next time they open a tab.notifications/inbox.py:29-36(leave, the only placecreated_at__lt=now - KEPT_FORis deleted);notifications/inbox.py:56-73(collect, which filters onshown_at__isnull=Truealone);notifications/models.py:18-20(BrowserNotice's docstring: "one nobody collects is thrown away afterKEPT_FOR").notifications:waiting,collectreturns the month-old notice, andapp.jsshows it as a desktop notification. Shown notices are likewise kept until the nextleave, however long that is.collect, delete the person's notices older thanKEPT_FOR(and those already shown) before reading, or read withcreated_at__gte=timezone.now() - KEPT_FOR; better still, reap every account's expired and shown notices in the scheduler pass besideerrands.forget_old(), so the table is kept to its promise whether or not anyone opens a tab.Done when
tests/test_browser_notifier.pythat leaves a notice, back-dates itscreated_atpastinbox.KEPT_FOR, and assertsinbox.collect(user)returns nothing and the row is gone.