Skip to content

feat(route): optimistic concurrency control for pair-meta updates - #560

Open
ZacLou wants to merge 1 commit into
StableRoute-Org:mainfrom
ZacLou:feat/route-occ-version-549
Open

feat(route): optimistic concurrency control for pair-meta updates#560
ZacLou wants to merge 1 commit into
StableRoute-Org:mainfrom
ZacLou:feat/route-occ-version-549

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Implements optimistic concurrency control (OCC) for pair-meta PATCH endpoints as requested in #549.

Changes

  • Added version: number to PairMeta type (default 0)
  • PATCH handlers now accept optional expected_version in request body
  • Rejects stale writes with HTTP 409 conflict when expected_version does not match current meta.version
  • Bumps meta.version atomically on every successful PATCH
  • Schema version bumped to 2 with migrateV1ToV2 backfill for persisted snapshots
  • Updated OpenAPI spec to document version and expected_version
  • Added comprehensive OCC tests

Testing

  • npm test -- --testNamePattern=OCC passes (7 new tests)
  • All existing pair-meta tests continue to pass

…ableRoute-Org#549)

- Add monotonic `version` field to PairMeta type
- Require client's expected_version on PATCH; reject stale writes with 409
- Bump schema version to 2 with migrateV1ToV2 backfill
- Update OpenAPI spec with version and expected_version
- Add comprehensive OCC tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant