mozilla-services / mozilla-services/syncstorage-rs
Enforce stricter offset parsing
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 86
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 21
Description
A followup to #368: Python syncstorage has stricter handling of offset values, raising an InvalidOffsetError when:
- a special "offset token" (
timestamp_bound:offsetformat) is specified forsort=index - a regular offset (just a plain numeric
offsetvalue) for other sort types
The change to db-tests' get_bsos_limit_offset in #368 somewhat came across case #1: the fact that passing a timestamp bound to sort=index is bogus.
Allowing case #2 made sense for the sake of deploying #368 (so a client w/ a plain offset retrieved from just before its deployment would continue working after the deployment). Now that it's deployed we could begin rejecting it also.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing offset handling in the Rust service and inspect the db-tests get_bsos_limit_offset change from #368, using Python syncstorage's stricter behavior as the reference. Verify the handling for sort=index with timestamp-bound tokens and other sort types with plain numeric offsets; done means both invalid forms are rejected with InvalidOffsetError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100