fix(session): sort messages by creation time instead of id#21572
Open
sjawhar wants to merge 1 commit intoanomalyco:devfrom
Open
fix(session): sort messages by creation time instead of id#21572sjawhar wants to merge 1 commit intoanomalyco:devfrom
sjawhar wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: I found a potentially related PR: Related PR:
This PR (#17149) appears to address the same issue of ordering session messages by creation time rather than ID order. It's likely either a related/prior attempt at the same fix or a duplicate effort targeting the same underlying problem with message chronological ordering in sessions. |
82ab4fa to
f727938
Compare
f727938 to
b77fd65
Compare
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.
Issue for this PR
Closes #15657
Closes #17012
Closes #21569
Type of change
What does this PR do?
This fixes session logic that assumed message IDs were chronologically ordered.
The branch sorts session messages by creation time instead of raw ID order, updates revert paths to use index-based selection instead of ID comparisons, and updates the web session page so deep-linked sessions do not crash during initial message loading.
How did you verify your code works?
cd packages/util && bun test src/message.test.tscd packages/util && bun typecheckcd packages/opencode && bun typecheckcd packages/app && bun typecheckcd packages/ui && bun typecheckScreenshots / recordings
Built web session page smoke-tested locally with Playwright after the deep-link crash fix.
Checklist