mozilla-services / mozilla-services/syncstorage-rs

Enforce stricter offset parsing

Open
#440 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2 enhancement self-hosting-phase2
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:offset format) is specified for sort=index
  • a regular offset (just a plain numeric offset value) 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.