Bell: lock-expiry notification + notification retention setting (lean at scale) #402
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/Cairn#402
Loading…
Add table
Add a link
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?
Ratified design (follows the #394 "no notification in v1" deferral and the bell architecture review).
Principles
The bell stays a derived view (no event store, no sweeper) — that is what keeps it lean where Nextcloud fights multi-GB activity tables and Novu TTLs its feed at 1 month. New event kinds must be derivable from live state.
Lock-expiry notification
locks.json(policy lens, revivable). The feed derives from them: for the requesting user, every manual lock that is live by its own record but lapsed under the cap becomes an item — kindlock-expired,file= basename,At= lapse moment (rec.At + cap).Retention setting
notifyRetentionDays(int; 0/absent = default 30; max 365; deliberately no "forever") in Basic settings, whose first card is retitled "Name & Notifications" (→ "General" if a third loose setting ever lands there). It governs:locks.jsonon save (lazy, like dav reaping).notify-seen.jsonentries older than H are dropped on save; lossless (a watermark older than the horizon is behaviourally identical to none), bounding the file by users active within H instead of users-ever.Scale guard
Per-user in-memory feed cache (TTL ~45s, invalidated by read-all/clear): backend cost ≤1 derivation per user per TTL regardless of tabs/devices — today every tab polls every 60s and each derivation is 1+P backend LISTs. Nothing persisted; memory bounded by active users.
Out of scope, flagged separately:
peer-transfers.jsongrows per send forever and also feeds the Transfers view — retention for it is its own decision.Refs: #394 (lapse-lazily decision), #147 (bell), mockup
lock-notification-mockup.html(approved).