Skip to content

feat(messaging): synthesize inbox action_url from event source (ADR-0030 L5)#1456

Merged
xuyushun441-sys merged 2 commits into
mainfrom
feat/notification-action-url-from-source
Jun 1, 2026
Merged

feat(messaging): synthesize inbox action_url from event source (ADR-0030 L5)#1456
xuyushun441-sys merged 2 commits into
mainfrom
feat/notification-action-url-from-source

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

What

The Console bell reads sys_inbox_message (the ADR-0030 L5 in-app materialization), which carries only action_urlnot the L2 sys_notification event's source_object/source_id. Producers that pass a source but no explicit payload.url (collaboration @mention, record assignment) materialized inbox rows with no navigable link, so clicking the bell entry could not deep-link to the originating record.

This synthesizes an app-relative /{object}/{id} link from emit()'s source when no explicit payload.url/payload.actionUrl is supplied, in both the inline fan-out and the durable-outbox enqueue paths (actionUrlFor() helper). Precedence: explicit url → source-derived link → undefined.

Keeps the L5 materialization self-sufficient for navigation, which the objectui bell cut-over consumes (companion objectui PR repoints the bell to sys_inbox_message + sys_notification_receipt).

Why

Part of the ADR-0030 objectui cut-over. The re-modeled sys_notification is now the L2 event (no recipient/read columns); the bell can no longer fall back to source_object/source_id on the event, so the link must ride on the materialization.

Tests

3 new messaging-service.test.ts cases — source→/obj/id, explicit-url precedence, neither→undefined. All 95 @objectstack/service-messaging tests green.

Verification

Verified live in the showcase Console (fresh sqlite, full pipeline): a materialized sys_inbox_message with a delivered receipt lit the bell badge; the popover rendered the row; "mark all read" updated the existing receipt in place to read (no duplicate, unique index respected) and cleared the badge.

🤖 Generated with Claude Code

…030 L5)

The bell reads `sys_inbox_message` (the L5 materialization), which carries
only `action_url` — not the L2 event's `source_object`/`source_id`. Producers
that pass a `source` but no explicit `payload.url` (collaboration @mention,
record assignment) therefore materialized inbox rows with no navigable link,
so clicking the bell entry couldn't deep-link to the record.

Synthesize an app-relative `/{object}/{id}` link from `emit()`'s `source` when
no explicit `payload.url`/`payload.actionUrl` is given, in both the inline
fan-out and the durable-outbox enqueue paths. An explicit url still wins; with
neither url nor source the link stays undefined. This keeps the materialization
self-sufficient for navigation (the objectui bell consumes action_url).

Tests: 3 new cases (source→link, explicit-url precedence, neither→undefined);
all 95 service-messaging tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 8:06am

Request Review

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Jun 1, 2026
@xuyushun441-sys xuyushun441-sys merged commit 3a45780 into main Jun 1, 2026
12 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/notification-action-url-from-source branch June 1, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants