Skip to content

F12-Q: make the Android plugin sync path server-free - #168

Merged
Fledgewing merged 17 commits into
feature/0.12from
f12/plugin-sync-owner
Nov 27, 2026
Merged

Fledgewing merged 17 commits into
feature/0.12from
f12/plugin-sync-owner

Conversation

@Fledgewing

@Fledgewing Fledgewing commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Android position and lifecycle sync now use BookSync Library commands and one companion sync owner. The plugin keeps native locator/geometry captures, scheduling and the one-draw consent prompt. The five retired Lua sync implementations are deleted; KOReader’s independent built-in sync is unchanged.

The legacy class/API is disarmed before instantiation. Activation requires that retirement handshake, then imports all five lifecycle phases, pending remote applications, valid generation fallback and account provenance into one SQLite journal. Import checkpoints commit before source retirement; crash tests cover both sides of checkpoint/retirement and partial renames. Ambiguous/corrupt sources remain untouched, and archived originals survive delivery.

SyncOwner/PositionPolicy now own marker, override, decline, reread, behind-hold and stale-consent handling. Every shared position-policy fixture passes. Offline captures and native verification survive restarts. Proven old-account rating/review history is retained under that account’s namespace, preserving explicit clears after a login change. Custom direction preferences (including saved pre-preset values) are translated in the companion; scheduled prompt checks stay quiet, cached silent placements run before draw, and post-draw moves use consent. Successful pushes publish the committed position and invalidate stale consent tokens. Delayed decisions reject document/mode changes; stale captures cannot reclaim the current sidecar lease, and old-path previews for the same document are invalidated. Open-sidecar leases survive close capture and companion restart until native closure; sidecar writes precede acknowledgment. Disabled annotation exchanges stay disabled, unverified rows cannot become uploads, and statistics windows preserve equal-timestamp rows.

Reuse: ko/library.lua:134 and companion LibraryAccount.kt:42 at prerequisite 71f7fc5; existing Sql/LuaValue, native schedule and Wi-Fi lease modules. ServerAdapter is extended minimally with opaque lifecycle capture/phase, normalized position and native-verification operations. The existing serial LibraryAccount executor remains the only sync owner. Added named consent/verification budgets and timing spans; strengthened universal plugin Lua sync-call/route guards; updated interface/migration/backend-independence notes and all four platform cells.

Parallel boundary: covers and mirror/catalog ownership are merged from F12-Q2; grouping/copies/recommendations/end-of-book remain its scope. The old localfirst file’s unrelated catalog display helpers remain as local_view.lua until that cutover. Neutral Library middleware hooks signal those existing jobs. This PR makes the sync path server-free; it does not claim the entire plugin is server-free. Merged latest feature/0.12 including #163, #165, #166, #167, #169, #170, #171, #172, #173 and #174.

Validation: full companion verifySharedVersion/testDebugUnitTest/assembleDebug/lintDebug (749 tests, zero failures, four existing skips), shared policy fixtures and toy-adapter end-to-end offline/restart/account/consent tests; five-phase migration/crash/provenance and sidecar/statistics tests; 237 pure Lua tests and 289 native flow tests; boundary, feature, product-name, credits, packaging, pinned KOReader compatibility, version, installer, sideload, release-input, workflow and attestation checks. CI must pass at the final head before squash merge. No device/adb operation, release or tag. Host timings are not device acceptance; maintainer device targets remain pending.

Fledgewing and others added 17 commits November 26, 2026 09:47
Retire the legacy writer before importing every pending phase into the durable,
account-scoped journal. Keep native captures and one-draw consent in the reader;
all sync policy, state, sidecar work and requests use the companion single owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Publish committed positions and reject stale consent after delivery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Invalidate old-path previews for the same owned document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Preserve the neutral catalog command bridge and bind lifecycle hooks before native initialization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Retain both command families, screen budgets and native registrations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
Retain the neutral sync test port alongside explicit legacy Home compatibility coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01BLYjLJzEkmBRpMx6vsJ4xw
@Fledgewing
Fledgewing merged commit 44034c7 into feature/0.12 Nov 27, 2026
21 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.

1 participant