Skip to content

fix(formulus): better reset handling#601

Merged
r0ssing merged 12 commits intoOpenDataEnsemble:devfrom
HelloSapiens:feat/better-reset-handling
Apr 12, 2026
Merged

fix(formulus): better reset handling#601
r0ssing merged 12 commits intoOpenDataEnsemble:devfrom
HelloSapiens:feat/better-reset-handling

Conversation

@r0ssing
Copy link
Copy Markdown
Contributor

@r0ssing r0ssing commented Apr 12, 2026

Description

Adds a defensive client check in Formulus so that after a successful sync pull, push, or attachment manifest response, if repository_generation in the response does not match the epoch the client sent, the app throws RepositoryResetRequiredError instead of persisting the server epoch—preventing silent advancement (e.g. 4→5) when an empty pull leaves stale local rows. Pull/push/manifest requests also send repository_generation in the JSON body (alongside the header) per OpenAPI, so the server can resolve the epoch if headers are stripped.

On Synkronus, adds unit tests that assert ParseClientRepositoryGeneration behavior (header vs body, invalid header) and handler-level tests that Pull/Push return HTTP 409 with repository_reset_required and x-repository-generation when the client epoch does not match the mock server epoch, plus a case proving the header wins over a conflicting body.

Type of Change

  • Bug Fix
  • New Feature / Enhancement
  • Refactor / Code Cleanup
  • Documentation Update
  • Maintenance / Chore
  • Other (please specify):

Component(s) Affected

  • formulus (React Native mobile app)
  • formulus-formplayer (React web app)
  • synkronus (Go backend server)
  • synkronus-cli (Command-line utility)
  • Documentation
  • DevOps / CI/CD
  • Other:

Related Issue(s)

Closes/Fixes/Resolves:


Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manually tested
  • Tested on multiple platforms (if applicable)
  • Not applicable

Breaking Changes

  • This PR introduces breaking changes
  • This PR does NOT introduce breaking changes

If breaking changes, please describe migration steps:


Documentation Updates

  • Documentation has been updated
  • Documentation update is not required

Checklist

  • Code follows project style guidelines
  • All existing tests pass
  • New tests added for new functionality
  • PR title follows Conventional Commits format

Thank you for contributing to Open Data Ensemble (ODE)!

@r0ssing r0ssing requested a review from najuna-brian April 12, 2026 13:42
@r0ssing r0ssing merged commit ef817f9 into OpenDataEnsemble:dev Apr 12, 2026
17 checks passed
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.

2 participants