[codex] misc sync and startup fixes#154
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8572f9bbc9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (ActiveSyncGuard.isActive) { | ||
| Timber.d("LibrarySyncWorker: in-app sync already active, skipping this run") | ||
| return Result.success() | ||
| } |
There was a problem hiding this comment.
Prevent worker/app sync overlap
When a scheduled sync starts while the app is not already syncing, this one-time check passes and the worker never reserves the cache for its own writes; if the user opens the app or triggers a manual/progressive sync before the worker finishes, ProgressiveSyncCoordinator can also enter syncBackgroundFull and both jobs write the same section index/checkpoint temp files. Use a shared guard or mutex that the worker holds around syncBackgroundFull and that app sync also honors, rather than only doing this preflight check.
Useful? React with 👍 / 👎.
What changed
Why
Validation
./gradlew :app:compileDebugKotlin