Keep paged conversation history stable during live replies - #26
Merged
Merged
Conversation
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.
Older history now loads in bounded pages while a reply continues streaming. Persisted message IDs bind saved history and live events to the same conversation, so an earlier page cannot replace the active reply. Android and iOS retain reading position across prepends, retries and leaving the conversation; returning to the latest message resumes following.
The server keeps the existing recovery endpoint and adds a buyer-scoped pure-read history endpoint. KMP validates page boundaries and merges the history prefix separately from the active tail. Native clients retain request ownership and cancellation; iOS takes row positions from SwiftUI geometry, uses a small scroll-position bridge and waits for an active gesture before applying a prefix. Each new geometry sample can adjust the offset only once; cached offscreen native views cannot become reading anchors. SQLite still reads and saves whole conversation JSON.
Release replay tests compare paced and burst delivery while following the reply or reading history. These establish diagnostic workloads, not an optimization claim. Debug-only touch fixtures exercise pagination without a model, business service or stored credentials; CI also compiles the UI test target.
Validation:
083cfb2f899685f4b5dfff71c4f1c047f3f94fe4; ARM64 Release build passed. Touch assertions retain a partially visible message within 2 points and verify the earlier page was applied. These are fixture-based interaction tests, not frame-rate measurements.