feat(automation): notify node click-through target (source_object/source_id) (#2675) - #2677
Merged
Conversation
…rce_id) (#2675) The flow `notify` node consumed only recipients/title/message/channels, so every notification it emitted had `sys_notification.source_object` / `source_id` = null — inbox notifications could not be clicked into the related record. Read `sourceObject`/`sourceId` (or the nested `source:{object,id}` form) and `actorId` from the node config and forward them to `messaging.emit()`, which already persists the source columns and synthesizes a `/{object}/{id}` inbox deep-link. Both keys interpolate flow variables; a half-specified target is dropped so the inbox never renders a dead link. Accept `url` as an alias for `actionUrl`, and publish a `configSchema` documenting the accepted keys. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
问题
Fixes #2675.
Flow 的
notify节点无法给通知附带点击跳转目标——生成的sys_notification.source_object/source_id恒为null,inbox 里点通知无处可跳。节点此前只消费recipients/title/message/channels,写出的 payload 只有{ title, body }。根因很窄:下游 messaging 服务的
emit()早已支持source: { object, id }/actorId,会把它们写进sys_notification.source_object/source_id/actor_id,并在无显式 URL 时合成/{object}/{id}的 inbox 深链(actionUrlFor)。缺口只在 notify 节点从不把这些从 config 转发进emit()。改动
packages/services/service-automation/src/builtin/notify-node.ts:messaging.emit({ source, actorId }):sourceObject/sourceId(canonical,对齐 DB 列名)source: { object, id }(对齐 emit 契约)actorIdinterpolate,支持sourceId: '{new_quotation.id}'这类流程变量。actionUrl/url仍优先于合成链;新增url作为actionUrl别名。configSchema,让 Studio 表单可发现这些键(不加required,不锁死额外键——纯 discoverability)。用法(即 issue 的期望):
验证
source形式 + actorId、半指定丢弃、url别名)。service-automation全套 256 passed;service-messagingemit()已有测试覆盖source→source_object/source_id落库 +/{object}/{id}深链合成,整条链路端到端有据。🤖 Generated with Claude Code