Skip to content

fix: migration#30720

Closed
neriousy wants to merge 1 commit into
anomalyco:devfrom
neriousy:fix/migration
Closed

fix: migration#30720
neriousy wants to merge 1 commit into
anomalyco:devfrom
neriousy:fix/migration

Conversation

@neriousy
Copy link
Copy Markdown
Contributor

@neriousy neriousy commented Jun 4, 2026

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Fixes migration regression introduced in #30632

Previously, 20260603040000_session_message_projection_order assumed every existing session_message projection had a matching durable event row. Getting error Cannot migrate session_message projections without matching durable events

Now the migration does this:

  1. Adds session_message.seq.
  2. Uses durable event.seq when the matching event exists.
  3. For projection-only rows, assigns a stable fallback order per session using time_created, id.
  4. Normalizes the staged seq values back to zero-based order.
  5. Updates event_sequence.seq to at least the max projected message seq, so future durable events do not reuse a sequence number.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No issue referenced. Please add Closes #<number> linking to the relevant issue.
  • "How did you verify your code works?" section is empty. Please explain how you tested.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

The following comment was made by an LLM, it may be inaccurate:

Found a potentially related PR:

PR #30705: fix(opencode): v2 session migrate by setting correct seq and prevent dedupe project id

Why it might be related: This PR also addresses session migration issues with seq fields and durable events, which is the same core problem area as PR #30720. Both appear to be dealing with session_message projection sequencing and durable event synchronization.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jun 4, 2026
@github-actions github-actions Bot closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant