Enforce stricter offset parsing

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #494 by @fzzzy — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python, rust
Domain
api, backend

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.

Description

2 enhancement self-hosting-phase2

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.

Dominant language
Rust
Stars
1.8k
Forks
87
Avg merge
1d 9h
Merged PRs (30d)
62

Getting set up

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.

More from mozilla-services/syncstorage-rs

All issues in mozilla-services/syncstorage-rs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.