Skip to content

✨ feat(android): wire sideload import to library-mirror push#64

Merged
vitofico merged 1 commit into
mainfrom
chore/wire-sideload-push
May 24, 2026
Merged

✨ feat(android): wire sideload import to library-mirror push#64
vitofico merged 1 commit into
mainfrom
chore/wire-sideload-push

Conversation

@vitofico

Copy link
Copy Markdown
Owner

Phase 0 cross-bundle wire-up follow-up.

A-3 (sideload pipeline, in Phase 0 bundle 3) exposed an onSuccessfulImport hook on SideloadImporter. A-4 (WorkManager library-mirror push, also in bundle 3) exposed LibraryMirrorPushScheduler.enqueueAfterLibraryChange(context) as the entry point for an out-of-band push. They were intentionally not connected in the bundle PR so the diff stayed close to the constituent PRs.

Now that both are on main, wire them: a freshly imported book triggers an expedited library-mirror push instead of waiting for the next periodic run.

Diff

One file, six lines added.

+ import LibraryMirrorPushScheduler
+ runCatching { LibraryMirrorPushScheduler.enqueueAfterLibraryChange(appContext) }

The scheduler coalesces concurrent enqueues, so this is safe alongside the periodic worker. Existing onSuccessfulImport actions (sync-cursor reset + expedited sync enqueue) are preserved.

Verification

  • scripts/dgradle :app:testDebugUnitTest :app:assembleDebug — BUILD SUCCESSFUL.

After Bundle 3 landed A-3 (sideload) and A-4 (library-mirror push job)
in parallel branches, the integration between them was deliberately
deferred: A-3 exposed an `onSuccessfulImport` hook; A-4 exposed
`LibraryMirrorPushScheduler.enqueueAfterLibraryChange`. Both pieces are
on main now, so wire them up: a freshly-imported book triggers an
expedited library-mirror push instead of waiting for the next periodic
run. The scheduler coalesces, so this is safe alongside the periodic
worker.
@vitofico
vitofico merged commit 7295a81 into main May 24, 2026
7 checks passed
@vitofico
vitofico deleted the chore/wire-sideload-push branch May 24, 2026 11:59
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