Skip to content

fix(sync): adopt server epoch on fresh install / empty push without c…#621

Merged
r0ssing merged 1 commit intoOpenDataEnsemble:devfrom
najuna-brian:false-positive-wipe
Apr 26, 2026
Merged

fix(sync): adopt server epoch on fresh install / empty push without c…#621
r0ssing merged 1 commit intoOpenDataEnsemble:devfrom
najuna-brian:false-positive-wipe

Conversation

@najuna-brian
Copy link
Copy Markdown
Contributor

Description

Fixes the first‑sync repository reset / wipe warning when the device has not actually asserted a repository epoch yet, but Synkronus is already on repository_generation > 1 (e.g. after a server reset).

What changed

  • synkronus (Push): If the client sends no repository_generation (header/body) and records is empty, respond 200 with the server’s epoch and current version instead of calling ProcessPushedRecords with the parser’s default 1, which previously always failed the pre‑loop generation check against a higher server epoch.
  • formulus: When storage has 1 but there is no observation cursor yet (@last_seen_version missing / empty / 0), omit repository_generation on requests so the server can treat the client as adopting the current epoch (same as a missing key).

Tests

  • Go: TestPush_emptyRecords_missingRepositoryGeneration_ok
  • TS: effectiveRepositoryGenerationForRequest unit tests

Closes #609

@najuna-brian najuna-brian requested a review from r0ssing April 25, 2026 22:35
Copy link
Copy Markdown
Contributor

@r0ssing r0ssing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Nice to have the push request behavior match the pull and attachment 🦒

@r0ssing r0ssing merged commit 69cd5a1 into OpenDataEnsemble:dev Apr 26, 2026
14 checks passed
@najuna-brian najuna-brian deleted the false-positive-wipe branch April 27, 2026 08:44
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.

[Formulus] Data generation handling

2 participants