Skip to content

Discard stale notification responses after account changes or reset #41

Open

Description

@LunaStev

Problem

NotificationStore resets accountId/items but in-flight load and mutation promises continue writing shared state. An old account's delayed request can repopulate the menu after a reset or another account's load.

Evidence / regression scenario

Source-derived race in load/markRead/markAllRead: callbacks do not verify accountId after awaiting.

Code references

Audit baseline: 50eb207.

Completion criteria

  • Associate each load/read mutation with the originating account and a request generation; apply results only while both remain current.
  • Ensure reset invalidates pending success/error/finally callbacks rather than only clearing arrays.
  • Use deferred promise tests for logout/reset during a request and account A -> B with reverse completion order.
  • Keep unread counts and loading state scoped to the current account; do not change server access rules.

Scope and dependencies

Difficulty: medium.

Client stale-state isolation only. Do not publish real account data in fixtures or claim a server-side authorization bypass.

Backlog index: #12. Keep the change limited to this issue and include focused verification in the pull request.

Activity

  1. added
    bug
    help wanted
    notifications
    priority high
    needs testing
    on Sep 23, 2026
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

    bughelp wantedneeds testingnotificationspriority high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions