This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(app-shell): the bell polls the inbox on every console surface, not only inside an app (#4110) - #4199
Merged
Conversation
…t only inside an app (#4110) The top-bar bell's `sys_inbox_message` + `sys_notification_receipt` poll was gated on the header's `isApp` variant flag — the flag that exists to hide the app-only presence avatars and connection dot. The bell itself renders in every variant, so on Home, Organizations and the full-page AI screen its Notifications tab held `[]` forever: "Unread" read "You're all caught up" and "All" — which applies no predicate at all — read "No notifications", on the very page whose To-do card (`useHomeInbox`, ungated) was listing the same row from the same object. The popover's own filter and its (topic, title) coalescing (#2765) are innocent: given the row they render it. The inbox is scoped to the signed-in user, not to the app in the URL, so the poll is now scoped by `user?.id` only. Regression test renders the header against a fake adapter holding one canonical MessagingService-emitted row and asserts the bell lists it in every variant; the `variant="app"` case is the control that never broke.
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 10, 2026 20:38
This was referenced Aug 10, 2026
This was referenced Aug 11, 2026
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 17, 2026
…p, from one shared fetch (objectstack-ai#4197) (objectstack-ai#4223) * fix(app-shell): the bell's Approvals and Activity tabs fill in off-app, from one shared fetch (objectstack-ai#4197) `AppHeader` gated the pending-approvals poll and the `sys_activity` read on `variant === 'app'`. The bell renders on Home, Organizations and the full-page AI screen too, so off-app both tabs were permanently empty — on the very page whose own To-do and activity cards (`useHomeInbox`, ungated) were listing the same rows from the same endpoint and the same object. Since objectstack-ai#4199 un-gated the inbox half, the badge (`unreadTopics + pendingApprovalsCount`) fetched only its first addend off-app: one user with one set of data read 1 on Home and 3 inside an app. Neither feed is app-scoped — approvals are scoped to the user, activity to the tenant — so both are un-gated. To avoid paying for that with duplicate reads (on `/home` the bell and the cards mount in one tree), a module-scoped store `hooks/sharedUserFeeds` now owns each feed: one in-flight request, one 30s approvals poll, one 404-retires-the-feature rule, with the bell and `useHomeInbox` both subscribing. Home keeps its narrower cut of the activity rows (human actors only) by filtering the shared feed at its call site. Presence stays app-scoped: the avatars and the connection dot remain behind `isApp`, and presence was never a read at all — it is a transport-level subscription (`useTenantPresence`), which is why the effect formerly named `fetchPresenceAndActivities` only ever fetched `sys_activity`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 * test(app-shell): anchor the presence boundary pin on a read both sides issue (objectstack-ai#4197) Asserting an absence needs the tree to have settled first, and the case used the `sys_activity` read as that settle point — which the `home` variant does not issue on `origin/main`. So under reverse verification the presence pin went red for a timeout that says nothing about presence, when the whole point of a boundary pin is to be green on BOTH sides. Anchored on the inbox read instead: ungated in every variant since objectstack-ai#4199, so it arrives before and after, and what the case reports is the render gate it was written to watch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 --------- Co-authored-by: Claude <noreply@anthropic.com>
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 17, 2026
…tstack-ai#4230) (objectstack-ai#4284) objectstack-ai#4230 reported the console bell dead again and filed it as a regression of objectstack-ai#4110 / PR objectstack-ai#4199. It is not a regression: the QA run vendored console 09987b6 (2026-08-09 02:35:56Z) and objectstack-ai#4199 landed as 7b07832 (2026-08-10 20:39:10Z), 42 hours later. `git merge-base --is-ancestor 7b07832 09987b6` exits non-zero, and that console's AppHeader.tsx line 338 still reads `if (!dataSource || !isApp || !user?.id) return;` — the exact gate objectstack-ai#4199 removed. No production code needed changing. What the round did expose is a hole in objectstack-ai#4199's own pin: every case in AppHeader.inboxVariant.test.tsx held ONE row and never touched the popover's Unread/All sub-filter, so nothing could tell "Unread is empty because every row is read" apart from "the panel was handed nothing" — and the reading under All is the load-bearing half of the reported symptom, because All applies no predicate at all. Adds eight cases driving the QA payload (ten sys_inbox_message rows, mixed read-state, including the approval.reminder objectstack-ai#4230 names) through the real AppHeader + InboxPopover pair under BOTH filters, plus the grouping fold (a repeated topic shows x2 unread / x3 all rather than vanishing) and the badge reconciliation. Reverse-verified: restoring the isApp gate turns all eight red on home/orgs and leaves variant="app" green — objectstack-ai#4110's signature. Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 Co-authored-by: Claude <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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #4110
Root cause
Not the popover.
InboxPopovernever filters a canonical inbox row away — its(topic, title)coalescing (#2765) and its topic/source handling are innocent, and the "All" sub-filter applies no predicate at all, which is why "All" reading "No notifications" was the tell: the component was handed an empty array.The array is empty because the bell's poller never ran.
AppHeader's inbox readwas gated on the header's
isAppvariant flag:isAppisvariant === 'app', true only underConsoleLayout(/apps/:appName/*).HomeLayoutrendersAppHeader variant="home",OrganizationsLayoutrendersvariant="orgs", andAiChatPagerendersvariant="home"— the bell renders in all of them, but on all of them the effect returns before issuing a request. So the tab was empty forever, independent of row count, exactly as reported.Meanwhile Home's To-do card reads the same object through
useHomeInbox, which carries no such gate — hence one page showing the notification in a card and nothing in the bell.This matches the reporter's own network trace. The only inbox request observed was
top=5— that isuseHomeInbox(5), the card. The bell's read is$top: 20plus asys_notification_receiptread; both are absent from the trace because the effect returned early. "The popover issues no request on open" was correct and, it turns out, load-bearing: nothing ever issued the bell's request.Origin:
20255e5411—feat(app-shell): notifications bell in AppHeader (M10.8), 2026-05-18. The gate arrived with the feature (copied from the presence/connection-status block above it, which is genuinely app-only chrome) and has never changed since.Reported as "worked under 17.0.0-rc.3 on 2026-07-31, broken under rc.5". The predicate that empties the tab is ~3 months old and untouched in that window:
git log -Sfinds it entering at20255e5411(2026-05-18) and nowhere else, andgit blameon the line agrees. The Home bell has never polled.The most likely reading of the passing 2026-07-31 e2e is that it asserted the popover on an app page (
/apps/...), where this bug does not reproduce — thevariant="app"control case in the new test passes both before and after this change. Worth confirming on the reporting side, because if the bell was genuinely working on Home under rc.3 then there is a second, platform-side cause that this PR does not address. Nothing found here explains it.Fix
Drop
isAppfrom the inbox poller's gate (and its dependency array). The inbox is scoped to the signed-in user, not to the app in the URL;user?.idremains the scope. Nothing else changes — no tab restructuring, no fetch-on-open (the shared-data architecture is untouched), no change to the badge logic from #4073.Reproduction and reverse verification
New test
packages/app-shell/src/layout/__tests__/AppHeader.inboxVariant.test.tsxrenders the header against a fake adapter holding one canonical MessagingService-materialized row (user_id,topic,title,body_md,action_url,notification_id,created_at) plus itsstate: 'delivered'receipt, and asserts the bell lists it per variant.On
origin/main, before the fix — the defect and its exoneration in one run:After the fix: 6 passed.
Reverse verification restored
!isAppinto the gate; predicted direction was 5 red / 1 green with theappcontrol surviving, and that is what ran. Note the sixth case, "shows the empty state only when the inbox is genuinely empty": it asserts that the read happened as well as that the copy appears, so it goes red with the gate restored. Without the read assertion it would have stayed green for the wrong reason — the empty-state copy is present either way.Local gates
No user-visible copy added or changed, so no i18n keys move.
Out of scope, filed separately
#4197 — the same
isAppgate still sits on the approvals-count poll and the activity fetch, so the bell's other two tabs stay dead off-app, and the badge (unreadTopics + pendingApprovalsCount) is now variant-dependent. Filed rather than fixed here to keep this PR to the reported tab; it also carries a real trade-off (duplicate reads withuseHomeInboxon Home) that deserves its own decision.Changeset
.changeset/inbox-popover-bell-polls-off-app-4110.md—@object-ui/app-shellpatch.Generated by Claude Code