fix(tui): redo and child session ordering across id wrap - #42590
Conversation
|
The following comment was made by an LLM, it may be inaccurate: I found a related PR, though it's in a different component: Related PR:
Note: This is listed in the PR description as a related issue (Related: #38787, #42589, #39806, #42461), so it's not a duplicate but rather a complementary fix to the same underlying problem. No duplicate PRs found |
b47e13a to
135d659
Compare
The ID format is unchanged in this PR (still wraps every ~795 days), this is tracked in #39806 |
Issue for this PR
Closes #42583
Related: #38787, #42589, #39806, #42461
Type of change
What does this PR do?
Message and session IDs contain a time field that wraps around every ~795 days. After a wrap, comparing IDs as strings no longer matches their real order in time.
Two places in the TUI still compared IDs as strings:
Also added a test making sure
trimSessionskeeps its output ordered by ID, since the app looks sessions up in that list by ID.This follows up on #40991/#40990, which removed the same kind of ID comparison on the server.
How did you verify your code works?
bun test test/util/inpackages/tuibun typecheckclean in new codeScreenshots / recordings
None
Checklist