Skip to content

fix(notification): ignore stale refreshes - #2844

Closed
HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/notification-latest-refresh
Closed

HandSonic wants to merge 1 commit into
OtterMind:mainfrom
HandSonic:fix/notification-latest-refresh

Conversation

@HandSonic

@HandSonic HandSonic commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

N/A - no matching issue was found.

Summary

Notification list and unread-count requests only checked whether the component was mounted. A slower mount or mark-read refresh could therefore overwrite a newer manual refresh. This change gives list and unread requests independent generations and invalidates both channels on unmount.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • Red tests committed refresh data and then regressed to mount data for both channels.
    • Notification coordinator and main-navigation contracts: passed.
    • Targeted ESLint: passed.
    • Full Community build and production bundle verifier: passed.
    • Fork code and CodeQL checks: passed.
  • Manual verification: N/A - independent deferred list/unread promises reproduce reverse completion without a browser.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: No API or persisted-state changes.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: N/A.
  • Community / Local / Pro boundary: Shared Community notification UI.
  • Backward compatibility: Latest list/unread responses retain existing rendering and mark-read behavior.

Reviewer map

  • Start here: NotificationRefreshCoordinator and guarded query functions in NotificationNav.
  • Failure condition: an older response commits or an unread-only refresh invalidates the list channel.
  • Rollback or disable path: Revert commit 20e91222a810dee8af7be623fab707c2262acc09; no migration is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: OpenAI Codex assisted with diagnosis, implementation, deterministic tests, verification, and adversarial review.

@HandSonic
HandSonic requested review from a team and openai0229 as code owners August 31, 2026 03:38
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 31, 2026
@HandSonic
HandSonic force-pushed the fix/notification-latest-refresh branch from 079b6da to d46ba10 Compare August 31, 2026 05:14
@HandSonic
HandSonic force-pushed the fix/notification-latest-refresh branch from d46ba10 to 20e9122 Compare September 3, 2026 08:08
@HandSonic

Copy link
Copy Markdown
Contributor Author

重新核对 Community 当前入口后确认,NotificationNav 已在 Community 边界重构中移除,当前没有生产引用;这项修复没有可达的 Community 用户路径。为避免维护不可达组件,主动关闭。若通知入口重新启用,可基于现有测试和实现重新提交。

@HandSonic HandSonic closed this Sep 3, 2026
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants