feat(messaging): synthesize inbox action_url from event source (ADR-0030 L5)#1456
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
The Console bell reads
sys_inbox_message(the ADR-0030 L5 in-app materialization), which carries onlyaction_url— not the L2sys_notificationevent'ssource_object/source_id. Producers that pass asourcebut no explicitpayload.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 fromemit()'ssourcewhen no explicitpayload.url/payload.actionUrlis 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_notificationis now the L2 event (no recipient/read columns); the bell can no longer fall back tosource_object/source_idon the event, so the link must ride on the materialization.Tests
3 new
messaging-service.test.tscases — source→/obj/id, explicit-url precedence, neither→undefined. All 95@objectstack/service-messagingtests green.Verification
Verified live in the showcase Console (fresh sqlite, full pipeline): a materialized
sys_inbox_messagewith adeliveredreceipt lit the bell badge; the popover rendered the row; "mark all read" updated the existing receipt in place toread(no duplicate, unique index respected) and cleared the badge.🤖 Generated with Claude Code