Skip to content

refactor(app-shell): retire the dead InboxNotification.actor_name field - #5487

Merged
os-support-ai merged 1 commit into
mainfrom
claude/issue-5203-inbox-actor-name-retire
Aug 21, 2026
Merged

refactor(app-shell): retire the dead InboxNotification.actor_name field#5487
os-support-ai merged 1 commit into
mainfrom
claude/issue-5203-inbox-actor-name-retire

Conversation

@os-support-ai

Copy link
Copy Markdown
Collaborator

Fixes #5203

Retires InboxNotification.actor_name (packages/app-shell/src/layout/inboxGrouping.ts) — the last declared-but-unfilled member of that interface after objectui#5190 removed the sibling source_object / source_id pair.

The producer needed no change: mergeInboxRows never mapped the field, so the whole retirement is one deleted line plus the pins that keep it deleted. That is why hooks/sharedUserFeeds.ts appears in this diff only as a new test.

Both ends dead — measured on origin/main @ 490f4824, not inherited from the card

Producer and consumer were searched separately, with two independent instruments, and every zero was counter-probed against a sibling field known to be live.

Instrument 1 — text search, repo-wide

actor_name occurs 26 times in tracked .ts / .tsx on origin/main. Exactly 6 of those are reads, and every one of them belongs to a different declaration — the conflation trap the card flags:

shape declaration reads
sys_activity row inline in mapActivityRows hooks/sharedUserFeeds.ts:587
ApprovalActivity hooks/useRecordApprovals.ts:141 views/RecordApprovalsPanel.tsx:353
record activity row views/RecordDetailView.tsx views/RecordDetailView.tsx:1573
RecordActivityRow plugin-detail/.../recordActivityFeed.ts:94 recordActivityFeed.ts:159, record-history.tsx:100
approvals API row apps/console/src/services/approvalsApi.ts:156 ApprovalsInboxPage.tsx:1920
InboxNotification layout/inboxGrouping.ts:41 none

mergeInboxRows (hooks/sharedUserFeeds.ts:675) is the single producer of every row the bell and Home render; it maps id, notification_id, receipt_id, type, title, body, action_url, is_read, created_at and nothing else. InboxPopover reads id / title / body / created_at / is_read / action_url; useHomeInbox reads id / title / action_url / created_at / is_read. Neither names the field.

Instrument 2 — type-aware probe, immune to the name conflation

Rename the member on the interface and let tsc report everything bound to it, across both projects — tsc --noEmit (src) and tsc -p tsconfig.test.json (tests). Baseline: both green before either probe.

Probe — rename actor_name. Predicted 0 errors in both projects. Observed:

SRC=0
TESTS=0

Counter-probe — the same rename applied to action_url, a sibling that IS produced and read. Predicted: errors at the producer, at both consumers, and in the fixtures. Observed 3 + 12 errors:

src/hooks/sharedUserFeeds.ts(700,7): error TS2353: Object literal may only specify known properties, and 'action_url' does not exist in type 'InboxNotification'.
src/hooks/useHomeInbox.ts(141,22): error TS2339: Property 'action_url' does not exist on type 'InboxNotification'.
src/layout/InboxPopover.tsx(171,48): error TS2339: Property 'action_url' does not exist on type 'InboxNotification'.
SRC=2
... plus 9 fixture errors across 3 suites ...
TESTS=2

The instrument fires on all three binding kinds — producer literal, consumer read, test fixture. So the probe's zero is a reading of a working instrument, not a broken search.

Third leg — there was nothing to fill it FROM

sys_inbox_message (objectstack @ 7679f8b54, packages/services/service-messaging/src/objects/inbox-message.object.ts) declares id, user_id, notification_id, delivery_id, topic, title, body_md, severity, action_url, created_at. No actor column. So "make it live" was never a one-line producer change — it is a backend capability expansion, exactly as the card suspected. That settles the disposition the card left open, on evidence rather than preference.

Published type surface: unchanged

InboxNotification is not reachable from @object-ui/app-shell's public entry:

  • absent from src/index.ts and from src/layout/index.ts (the barrel it would have to pass through);
  • absent from the built dist/index.d.ts (checked after turbo run build --filter=@object-ui/app-shell) — 0 occurrences;
  • the package exports map offers only . and ./styles.css, so there is no deep subpath an external consumer could import it through.

The type is internal to the package, so removing an optional member is not an externally observable narrowing. Nothing user-visible ships, which is why the changeset carries an empty frontmatter — the repo's explicit "this publishes nothing" declaration, not a missing changeset. (node scripts/check-changeset-presence.mjs green.) This is recorded here rather than left implicit precisely because a published narrowing would have needed the opposite treatment.

Two pins, in opposite directions

A type pin alone cannot see the direction this contract is most likely to rot in, because that direction does not go through the type at all: the producer builds its row from an explicit field-by-field literal, and the cheap "improvement" is to spread the raw record into it. So there are two:

  • TYPE PINlayout/__tests__/inboxGrouping.test.ts: a @ts-expect-error that fails if the member is re-declared. Checked by tsc -p tsconfig.test.json, which is this package's type-check script and the CI Type Check job.
  • RUNTIME KEY-SET PINhooks/__tests__/sharedInboxFeed.rowShape.test.tsx: feeds the producer a raw sys_inbox_message row loaded with unmapped columns (user_id, delivery_id, severity, and an actor_name) and asserts the produced row's whole key set, not merely the absence of one key. It also asserts the mapping still works, so the key-set assertion cannot be satisfied by a producer that maps nothing.

Reverse verification — direction predicted before running

Both legs ablate a committed state, so restoring is git checkout and the tree is provably clean afterwards. Neither leg needs a rebuild: both suites import their subject through relative specifiers (../inboxGrouping, ../sharedUserFeeds), so no package dist is on the resolution path and no stale artifact can fake a green.

Leg 1 — re-declare actor_name on the interface.
Predicted: test type-check RED on an unused directive; the runtime suite stays GREEN, because a declaration nobody fills changes no runtime shape. Observed exactly that:

src/layout/__tests__/inboxGrouping.test.ts(89,7): error TS2578: Unused '@ts-expect-error' directive.
TYPECHECK=2
Test Files  2 passed (2)   Tests  10 passed (10)

Leg 2 — give the producer a ...m raw-row pass-through.
Predicted: the runtime key-set pin RED, the type pin GREEN, and satisfies InboxNotification silent — a spread is not excess-property-checked. Observed exactly that:

SRC_TYPECHECK=0
TEST_TYPECHECK=0
FAIL ... does not carry `actor_name` even when the raw row has one
  expect(Object.hasOwn(row, 'actor_name')).toBe(false)  →  expected true to be false
Test Files  1 failed | 1 passed (2)   Tests  2 failed | 8 passed (10)

Neither pin substitutes for the other: each is the only one that can see its own leg. After both legs, git status --porcelain is empty and the tree matches HEAD.

Local verification — all at 7c0a3fecb, on a clean tree

what result
pnpm exec vitest run packages/app-shell/ 460 files passed, 4458 passed / 1 skipped
the 20 suites touching this surface 20 passed, 270 tests
tsc --noEmit (app-shell src) 0
tsc -p tsconfig.test.json (app-shell tests) 0
eslint . in app-shell exit 0 (0 errors; 2502 pre-existing warnings)
eslint --max-warnings=0 on the 3 changed files exit 0
check:control-bytes green (4533 files)
check:phantom-deps / check:self-import / check:esm-specifiers green
check:changeset-presence / changeset:check green
control-byte self-scan of changed files clean

No test was skipped, disabled or quarantined by this change; the single skip in that run is pre-existing on origin/main. check:eager-closure was not run — its gauge reads apps/console/dist/eager-closure.json, which only exists after a console vite build this worktree never ran; it is unrelated to this diff and CI builds the console.

Scope

Four files: the interface, its two pins, the changeset. PR #5480's packages/app-shell/src/preview/ and packages/app-shell/src/views/ are untouched — verified against the three-dot diff, no breach. No governed surface touched.


Generated by Claude Code

…ld (objectui#5203)

`InboxNotification` (`layout/inboxGrouping.ts`) declared `actor_name`, and the
field was dead at both ends. `mergeInboxRows` (`hooks/sharedUserFeeds.ts`) is the
single producer of every row the bell and Home's action centre render and never
mapped it; neither consumer (`InboxPopover`, `useHomeInbox`) read it; and
`sys_inbox_message` declares no actor column for it to have been mapped FROM. It
was the last declared-but-unfilled member of the interface after objectui#5190
removed the sibling `source_object` / `source_id` pair.

Not a published type surface: `InboxNotification` is unreachable from this
package's public entry (absent from `src/index.ts`, `src/layout/index.ts` and the
built `dist/index.d.ts`; the `exports` map has no deep subpath), so this is an
internal narrowing and the changeset declares an empty frontmatter.

Two pins, in opposite directions:
  - a TYPE PIN in `layout/__tests__/inboxGrouping.test.ts` fails if the field is
    re-declared;
  - a runtime key-set pin in `hooks/__tests__/sharedInboxFeed.rowShape.test.tsx`
    fails if the producer is ever changed to spread raw `sys_inbox_message`
    columns through instead of mapping them field by field — the rot direction a
    type pin cannot see.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE
@github-actions github-actions Bot added the tests label Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 52 chunks) 3781.3 KB 3867.2 KB
Main entry chunk (gzip) 151.1 KB 350 KB
Entry file index-DKSrq6u8.js
Status PASS

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (index.js) 10.04KB 3.72KB
app-shell (runtime-config.js) 7.42KB 2.32KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 1.17KB 0.53KB
auth (AuthProvider.js) 29.34KB 7.05KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 6.35KB 2.43KB
auth (index.js) 2.77KB 1.22KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.02KB 0.89KB
auth (useIsWorkspaceAdmin.js) 3.04KB 1.45KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 506.94KB 113.63KB
core (index.js) 4.11KB 1.62KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 159.80KB 44.34KB
fields (index.js) 237.21KB 59.50KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.44KB 1.39KB
i18n (pickLocalized.js) 7.22KB 3.08KB
i18n (provider.js) 23.13KB 7.63KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 30.51KB 7.57KB
i18n (useSafeTranslation.js) 7.77KB 3.13KB
layout (index.js) 38.95KB 10.97KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.55KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useResponsiveConfig.js) 1.37KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 9.35KB 3.31KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 4.42KB 1.42KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 1.81KB 0.83KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 46.62KB 12.83KB
plugin-charts (index.js) 64.75KB 18.37KB
plugin-chatbot (index.js) 181.21KB 43.14KB
plugin-dashboard (index.js) 128.51KB 32.94KB
plugin-designer (index.js) 212.39KB 42.83KB
plugin-detail (index.js) 242.15KB 60.89KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 124.40KB 30.26KB
plugin-gantt (index.js) 164.10KB 39.87KB
plugin-grid (index.js) 200.75KB 54.24KB
plugin-kanban (index.js) 52.93KB 14.60KB
plugin-list (index.js) 111.64KB 27.13KB
plugin-map (index.js) 20.08KB 6.62KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.49KB 11.93KB
plugin-timeline (index.js) 26.68KB 7.66KB
plugin-tree (index.js) 8.50KB 2.88KB
plugin-view (index.js) 84.52KB 20.67KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 3.77KB 1.33KB
react (SchemaRenderer.js) 36.10KB 12.26KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.33KB 0.69KB
react (schema-input.js) 1.45KB 0.83KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (index.js) 4.77KB 2.16KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 10.76KB 3.17KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 6.92KB 2.40KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 0.20KB 0.18KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-retry.js) 4.32KB 2.02KB
types (index.js) 3.08KB 1.53KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 0.20KB 0.18KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@os-support-ai
os-support-ai marked this pull request as ready for review August 21, 2026 03:05
@os-support-ai
os-support-ai added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 3c822a5 Aug 21, 2026
23 checks passed
@os-support-ai
os-support-ai deleted the claude/issue-5203-inbox-actor-name-retire branch August 21, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InboxNotification.actor_name is declared but no producer fills it and no consumer reads it

2 participants