Skip to content

perf(platform): a per-user read watermark for the notification bell #5157

Closed

Description

@tale-code-bot

Split from #4708 (item 5 of 7), as triaged on TALE-117.

What the read does now

At feature-train 9173785 (services/platform/backend/domains/notifications/service.ts):

  • unreadCount (:174-190) counts all of the organization's notifications, with a NOT EXISTS (SELECT 1 FROM app.notification_reads r WHERE r.notification_id = n.id AND r.user_id = …) per row.
  • markAllRead (:215-235) inserts one app.notification_reads row per notification of the organization: INSERT … SELECT n.id, … FROM app.notifications n WHERE n.org_id = … ON CONFLICT DO NOTHING.
  • The routes are GET /api/app/notifications/unread-count and POST /api/app/notifications/read-all (routes.ts:64-72). They are read by the bell (app/features/notifications/components/notification-bell.tsx:39) and the list panel (notification-list-panel.tsx:144,146).

What to do

Add a per-user read watermark: the newest notification a user has read up to, per organization.

  • "Read all" moves the watermark.
  • The unread count only counts notifications after the watermark, less those read one by one.
  • The security-category visibility rule stays as it is.

Done means:

  • the count and read-all no longer cost more as the organization's notification history grows;
  • a migration adds the watermark;
  • tests cover the count, read-one, read-all and the security filter.

Activity

  1. added
    agent-ready
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 31, 2026
    3e8d222
  3. added
    perf
    on Oct 31, 2026
  4. added 2 commits that reference this issue on Oct 31, 2026
    e7d43d0
    9db7a44
  5. tale-code-bot commented on Oct 31, 2026

    @tale-code-bot
    CollaboratorAuthor

    Landed on release/0.6 with feature train #5221 (merged by rebase on 2026-10-31 at 20:26:51 UTC) as commit 9db7a44 (perf(platform): read the bell from a per-user watermark). It ships with Tale 0.6.0. GitHub closes issues only for commits on main, so the feature-train role closes this one. Task: TALE-253.

  6. added a commit that references this issue on Nov 1, 2026
    8d0010e
  7. 4 remaining items

  8. added 13 commits that reference this issue on Nov 2, 2026
    d26117a
    105aa09
    f6bab84
    6d285e5
    3a97bf5
    db37995
    bd32fb2
    b6d2dd2
    f929bf9
    1975229
    d1e47f4
    69b7801
    ee5e956
  9. added a commit that references this issue on Nov 15, 2026
    c350d59
  10. added a commit that references this issue on Nov 23, 2026
    bcbc4f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyperf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions