Repository navigation
Conversation
Preflight incoming category changes and cascading child deletes inside the page transaction. Defer without recording a sync error or advancing past the retry cursor, including during historical replay. Commit category creations and edits atomically with their outbox records. Cover HTTP-time edits, deletion, pagination, replay recovery, atomic rollback, and existing own-device skip behavior. Refs TNT-Likely/BeeCount-Cloud#96
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & Why
Protect unpushed local category changes from incremental pull and historical
replay, including server reconciliation events returned with
updated_by_device_id: null.The race is:
B still has an unpushed
local_changesrecord.This is companion hardening for TNT-Likely/BeeCount-Cloud#96. It does not
replace that PR's historical icon backfill and category reconciliation.
Changes
writes or custom-icon cleanup. Defer the entire page if an affected category
has an unpushed local change.
deletions as well as creations and edits.
retry cursor; a replay starting behind the saved cursor also persists its
earlier retry point so the next ordinary pull cannot skip the deferred page.
outbox records, closing the gap between updating the row and recording the
pending change.
changes and pending changes to unrelated entities do not block reconciliation.
No database migration, server API change, or UI change is required. Pending
changes remain available to the existing push path; after push acknowledges
them, the same pull page can be retried.
Related Issue
Related: TNT-Likely/BeeCount-Cloud#96.
Self-tested
Toolchain: Flutter 3.27.3, Dart 3.6.1, matching the repository's CI.
flutter test --no-pub: 1021 passed, 1 skipped.code, 13 failed / 4 passed; with this fix, 17 passed.
flutter analyze: no new diagnostics. The baseline's existing1 warning and 3 info diagnostics are unchanged;
--no-fatal-warningsand
--no-fatal-infoswere used without suppressing errors.dart formaton changed implementation/test files andgit diff --check.The tests cover an edit made while HTTP is in flight, retry after push, local
and remote deletion, parent-delete cascades, page-level atomicity, pagination,
replay cursor recovery, outbox-write rollback, and existing skip behavior.
The fake auth now exposes its device ID in user metadata like the real provider,
and the existing parent-link test acknowledges its seeded local changes before
testing a remote update.
Contributor License Terms
Contributor License Terms.