fix(storage): preserve divergent session variants#428
Conversation
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9b4f16c5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FROM source.lcm_external_payloads s | ||
| LEFT JOIN consolidation_message_map m | ||
| ON m.provider=s.provider AND m.original_id=s.message_id | ||
| WHERE NOT EXISTS ( | ||
| SELECT 1 FROM target_input.lcm_external_payloads t |
There was a problem hiding this comment.
Skip payload rows when their raw row is deduped
When a source raw message collides with the target on provider/message_id but only differs in representation (same content_hash, e.g. source external payload_ref B while the target is inline or uses payload_ref A), raw_content_divergent is 0 so the raw row is intentionally not inserted and consolidation_raw_map points at the target raw row. This block still inserts the source lcm_external_payloads row whenever B is absent from target_input, leaving a payload owner/file in the destination that no lcm_raw_messages row references; the verifier mirrors this union, so it will not catch the orphan. Gate these payload rows on the source raw row actually being preserved/remapped rather than on payload_ref absence alone.
Useful? React with 👍 / 👎.
Summary
Verification