Repository navigation
F12-Q: make the Android plugin sync path server-free - #168
Merged
Merged
Conversation
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
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
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
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
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
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
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
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.
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.