fix(app-shell): mark notifications read via the REST surface, not direct receipt writes#2743
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…ect receipt writes ADR-0103 made sys_notification_receipt engine-owned (enable.apiMethods = get/list), so the bell's direct dataSource create/update of receipts is rejected by the generic data API. The failure was swallowed (best-effort catch) and the 10s inbox poll flipped rows straight back to unread — notifications could never be marked read. Mark-read now goes through the framework's dedicated endpoints (POST /api/v1/notifications/read with the notification EVENT ids, and /read/all for mark-all), which upsert the receipt server-side. Optimistic UI update unchanged; rows without a notification_id still update optimistically only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Console side of objectstack-ai/objectstack#3353 (framework PR objectstack-ai/objectstack#3354).
Problem
Clicking a bell notification never cleared its unread state.
AppHeaderwrotethe read receipt by calling the generic data API directly
(
dataSource.create/update('sys_notification_receipt', …)), but ADR-0103 madesys_notification_receiptengine-owned (enable.apiMethods = get/list), sothose writes are rejected. The failure was swallowed (best-effort
catch) andthe 10s inbox poll flipped every row straight back to unread.
Fix
Mark-read now goes through the framework's dedicated REST surface —
POST /api/v1/notifications/readwith the notification event ids, and/read/allfor mark-all — which upserts the receipt server-side. The optimisticUI update is unchanged; rows without a
notification_idstill updateoptimistically only.
Requires the framework PR above, which both localizes the notification titles
and wires those
/api/v1/notificationsroutes (they existed as a dispatchhandler + discovery entry but were never mounted on the standalone server, so
they 404'd — ship the two together).
Verification
Drove this build against a real showcase server: clicking "全部标记为已读" issued
POST /api/v1/notifications/read/all → 200, receipts flippeddelivered → readserver-side, and the bell badge stayed cleared across the inbox poll instead of
resurfacing every notification as unread.
tscclean.🤖 Generated with Claude Code