Skip to content

feat(sync): apply batches per profile - #1631

Merged
3 commits merged into
mainfrom
feat/sync2-batches-per-profile
Nov 1, 2026
Merged

3 commits merged into
mainfrom
feat/sync2-batches-per-profile

Conversation

@A-EDev

@A-EDev A-EDev commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • A sync reads every linked profile's batches. The running profile's are applied; the others' are kept on the device and acknowledged, then applied in the order they were read, one per transaction, when that profile runs, before it sends anything.
  • Bootstrap starts each log at the lowest snapshot of the linked profiles and skips batches a profile's own snapshot already includes. A profile linked later reads its newest snapshot, then its earlier batches (spec "Reading a link from its snapshot").
  • Snapshots are written only for the running profile, once nothing kept for it is left. Garbage collection no longer waits for snapshots of deleted links.
  • Creating or joining a group links the profile together with the group. A restored device links Default when the logs name one link or none (snapshot manifests now count too) and leaves the choice to the user when they name several.

Related issue

Part of #1039 (Phase 6 of FLOW-SYNC/2).

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Build, packaging, or CI
  • Documentation

Validation

All Gradle runs used --offline -Dorg.gradle.jvmargs="-Xmx4096m -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8 -Djava.net.preferIPv6Addresses=true".

  • ./gradlew :app:assembleGithubDebug: not run on this branch; the top of the stack builds it.
  • ./gradlew :app:testGithubDebugUnitTest: 4733 tests, 0 failures, 46 skipped. New: ProfileLinksTest (several links, kept batches, bootstrap over several links, a link read later, garbage collection with a deleted link) and LinkedProfilesTest.
  • I ran any additional flavor-specific build or test tasks affected by this change: testFossDebugUnitTest 4690 tests, 0 failures, 46 skipped; ktlintCheck, spotlessCheck and lintGithubRelease pass; assembleFossRelease builds, FOSS arm64-v8a APK 21,803,740 B (budget 29,500,000 B); nightly_notes.py --check passes.
  • I manually tested the affected behavior on an Android device or emulator.

Test device and Android version:

Risk and compatibility

With only Default linked (until the next PR), a run in another profile keeps Default's batches and Default applies them after switching back. Kept batches live under linked_store/kept and go with the group when it is forgotten.

  • The change does not introduce secrets, private data, or unexpected telemetry.
  • New user-facing text uses Android string resources.
  • Dependency and lockfile changes are intentional and limited to this PR.
  • Room schema changes include the required version bump and migration, or this PR does not change the Room schema.
  • Breaking changes and upgrade steps are clearly documented.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 31, 2026
@A-EDev
A-EDev changed the base branch from feat/sync2-link-storage to main November 1, 2026 20:42
@A-EDev A-EDev closed this pull request by merging all changes into main in b7d3a0e Nov 1, 2026
@A-EDev
A-EDev deleted the feat/sync2-batches-per-profile branch November 1, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant