Skip to content

Correct the mention-linking comment and pin a Play action's create linking its mentions - #4352

Merged
mstomar125 merged 1 commit into
mainfrom
issue-4307-comment
Nov 25, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-4307-comment

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

The doc comment on sync_created_mentions said a node a Play's action creates is linked when its content is next edited. A reaction action creates through create_node, which links at creation; the comment now says that.

The comment also records what the code shows for the other path: an invariant action inserts its node inside its own transaction through insert_node_in_tx_no_invariant_dispatch, which does not call sync_created_mentions, so such a node is not linked at creation. That behaviour is unchanged and untested here; a follow-up issue may be wanted (see below).

Test added: create_node_action_links_the_mentions_of_its_content (a reaction action creates a node whose content mentions an existing node; get_mentions returns it right after). Mutation: removing the sync_created_mentions call from create_node fails it (verified). bun run test:changed passed.

Closes #4307

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE (head b5188a2)

Findings:

  • crud.rs:595-601 comment now matches the code. create_node calls sync_created_mentions (crud.rs:582), and the reaction create_node action goes through create_node (actions.rs:1849). The invariant path execute_create_node_in_tx (actions.rs:2429-2490) uses insert_node_in_tx_no_invariant_dispatch and never calls sync_created_mentions (the only callers are crud.rs:582, 969 and relationship.rs:2669), so "does not pass through this call" is accurate.
  • Test create_node_action_links_the_mentions_of_its_content (actions.rs:5463): passes (cargo test -p nodespace-core --lib create_node_action_links, 1 passed). Mutation: commenting out crud.rs:582 makes it fail at actions.rs:5494 (left: [], right: [target]). Restored.
  • Closes #4307: justified, the issue was the stale comment.

Follow-up recommended (not blocking): the comment now documents that nodes created by invariant actions are NOT mention-linked at creation. That looks like a real behavioral gap (content with nodespace:// mentions created by an invariant action has no mentions edges until next edit). Please file a separate issue to either link them in that path or record it as intended.

Not run: bun run test:changed, the rest of the core suite, clippy (stopped on coordinator instruction, machine overloaded; the merge gate covers them).

…e linking its mentions

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@mstomar125
mstomar125 merged commit 7f5c242 into main Nov 25, 2026
@mstomar125
mstomar125 deleted the issue-4307-comment branch November 25, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A stale comment says a Play-created node links its mentions only at its next edit; the code links it at creation

1 participant