Repository navigation
test: allow 200 empty batch with tail on at-tail unary reads - #166
Merged
Merged
Conversation
Confidence Score: 5/5
[Low impact] The PR appears safe to merge. SummaryUpdates integration tests to accept both server behaviors for unary reads at the tail.
No actionable issues found. Review used source inspection; integration tests were not run. Reviews (1) · Last reviewed commit: "test: allow 200 empty batch with tail on..." · Reviewed by Greptile |
shikhar
added a commit
to s2-streamstore/s2
that referenced
this pull request
Dec 5, 2026
…=0 at tail (#971) Unify `416 Range Not Satisfiable` semantics across single-batch and streaming reads. Fixes #316. - Return `416` only when the requested starting position is strictly beyond the tail without `clamp` (`seq_num > tail.seq_num` or `timestamp > tail.timestamp`). - Return `200` with `{ records: [], tail: Some(tail) }` when an in-range or clamped single-batch `wait = 0` read reaches the tail with no records (empty stream, `seq_num == tail`, `tail_offset = 0`, clamped start, or fully trimmed stream), simplifying `merge_read_session` to rely on `read_session` for stop conditions. - Pre-tail `count`/`bytes`/`until` cutoffs continue returning `200 { records: [], tail: None }`. - Update OpenAPI annotations (`s2-api`, `s2-lite`), SDK rustdocs (`s2-sdk`), `s2-lite` read tests, and `s2-sdk` tests (rollout-safe on `stream_ops.rs` until `s2-cloud` deploys). Related PRs: - s2-streamstore/s2-sdk-python#166 (merged) - s2-streamstore/s2-sdk-typescript#450 (merged) - s2-streamstore/s2-sdk-go#536 (merged) - s2-streamstore/s2-cloud#2082 - s2-streamstore/s2-specs#67 - s2-streamstore/docs#408
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.
Prepare integration tests for unifying
416 Range Not Satisfiablesemantics across unary and streaming reads (s2-streamstore/s2#316).At-tail unary
wait = 0reads (empty stream,clamp=truebeyond tail, auto-create on read) will return200with an empty batch andtailpopulated instead of416. Accept either200empty+tail or416during rollout so boths2-liteands2-cloudCI pass; strictly beyond-tail reads withoutclampcontinue asserting416.