Skip to content

Remove full database backups from position updates - #31

Merged
42lizard merged 1 commit into
mainfrom
fix/readest-transactional-native-update
Sep 26, 2026
Merged

42lizard merged 1 commit into
mainfrom
fix/readest-transactional-native-update

Conversation

@42lizard

@42lizard 42lizard commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

 apply Readest position
-  copy the complete firmware database to before.db
-  validate the copied identity and settings row
   open the existing firmware database read/write
   set synchronous=FULL
   BEGIN IMMEDIATE
+  validate identity and settings inside the transaction
   update exactly position + position_ts with compare-and-swap predicates
   verify one affected row and the complete resulting settings row
   COMMIT
+  record before.json, target.txt, readest-source-cfi.txt, and outcome.txt

Pre-commit failures roll back. An uncertain commit remains explicit; the next operation re-reads the firmware database and reconciles either the previous or committed position without restoring stale database contents.

Closes #29.

Evidence

  • Before: each applied Readest position retained a complete before.db copy.
    After: successful, rolled-back, and uncertain transitions retain only the small text/JSON audit.
  • ctest --test-dir build/readest-sync/host-linux --output-on-failure — 12/12 passed.
  • Resume fault injection covers cancellation, stale observations, unsafe triggers, denied updates, post-commit audit failure, app-state failure, and both possible observations after an uncertain commit.
  • docker compose run --rm qt6 make APP=readest-sync check — Qt6 ARM softfp, loader, resource format, and ABI ceilings passed.
  • Two-axis code review — no Standards findings and no Spec implementation defects.
  • PB743G U743g.6.11.1683: applied the pending Readest position for Beren und Lúthien, opened the native reader, returned, and reopened through Readest Sync. The audit reported committed, contained only four text/JSON files totaling 460 bytes, and created no before.db; pending state cleared and local/remote baselines converged.

Merge Danger

Door: Two-way

The change is cheap to revert and does not alter the firmware schema or the app's persisted sync format.

Blast Radius: Position apply

Only the explicit Open flow that applies a pending Readest reading position changes. Startup reads, normal native-reader handoff, and PocketBook-to-Readest uploads are unchanged.

@42lizard
42lizard merged commit 0c053e1 into main Sep 26, 2026
2 checks passed
@42lizard
42lizard deleted the fix/readest-transactional-native-update branch September 26, 2026 10: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.

Remove full database backups from native position updates

1 participant