Skip to content

Remove unreachable INSERT branch from storeMsgHeaderOnly - #37

Open
markmnl wants to merge 1 commit into
mainfrom
fix/remove-dead-header-only-insert
Open

Remove unreachable INSERT branch from storeMsgHeaderOnly#37
markmnl wants to merge 1 commit into
mainfrom
fix/remove-dead-header-only-insert

Conversation

@markmnl

@markmnl markmnl commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Confirmed follow-up (c) of #33: storeMsgHeaderOnly's INSERT branch was unreachable — code 11 is only issued when the parent row exists (handleAddToPath requires a stored, retrievable parent), so existingMsgIDForAddTo always finds the shared row and the attach path always wins. Had the branch ever run, the inserted row would have carried its own identity hash as psha256, and isMessageRetrievable would have recursed onto itself.

The function is now just: resolve the shared row, attach the batch's recipients, commit — with a missing shared row reported as an error instead of silently inserting a self-referential row.

No behaviour change on any reachable path.

🤖 Generated with Claude Code

Code 11 is only responded when the message being added to is already
stored (SS10.4 step 1), so the attach path always wins and the INSERT
branch was dead. Had it ever run, the inserted row's psha256 would have
equalled its own identity hash, making isMessageRetrievable recurse on
itself. The attach path is now the only path and a missing shared row
is an error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant