MS-1350 Worker scheduling simplification#1595
Merged
luhmirin-s merged 3 commits intomainfrom Feb 17, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Simplifies sync worker scheduling to prevent sync running immediately on app start by reducing explicit cancellations and making initial delay optional when scheduling periodic work via WorkManager.
Changes:
- Removed
rescheduleAftercommands and the “blockWhileUnscheduled” mechanism from scheduling commands/orchestrator execution. - Updated periodic worker scheduling wrapper to only apply
setInitialDelay(...)when explicitly requested. - Updated/removed unit tests to align with the new scheduling command API.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/sync/src/main/java/com/simprints/infra/sync/extensions/WorkManager.ext.kt | Makes periodic worker initial delay optional (sentinel-based) when building PeriodicWorkRequests. |
| infra/sync/src/main/java/com/simprints/infra/sync/SyncOrchestratorImpl.kt | Removes “cancel + block + reschedule” behavior from RESCHEDULE execution path. |
| infra/sync/src/main/java/com/simprints/infra/sync/ScheduleSyncCommand.kt | Removes rescheduleAfter variants and related command fields. |
| infra/sync/src/main/java/com/simprints/infra/sync/config/usecase/ResetLocalRecordsIfConfigChangedUseCase.kt | Switches from rescheduleAfter { ... } to explicit UNSCHEDULE → reset → RESCHEDULE flow. |
| infra/sync/src/test/java/com/simprints/infra/sync/config/usecase/ResetLocalRecordsIfConfigChangedUseCaseTest.kt | Updates assertions to expect explicit UNSCHEDULE + RESCHEDULE calls. |
| infra/sync/src/test/java/com/simprints/infra/sync/SyncOrchestratorCommandExecutionTest.kt | Removes tests targeting the deleted rescheduleAfter behavior. |
| infra/sync/src/test/java/com/simprints/infra/sync/ScheduleSyncCommandTest.kt | Removes tests covering the deleted rescheduleAfter command builders. |
infra/sync/src/main/java/com/simprints/infra/sync/extensions/WorkManager.ext.kt
Show resolved
Hide resolved
.../java/com/simprints/infra/sync/config/usecase/ResetLocalRecordsIfConfigChangedUseCaseTest.kt
Show resolved
Hide resolved
|
alexandr-simprints
approved these changes
Feb 17, 2026
alex-vt
approved these changes
Feb 17, 2026
BurningAXE
approved these changes
Feb 17, 2026
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.



JIRA ticket
Will be released in: 2026.2.0
Root cause analysis (for bugfixes only)
First known affected version: 2026.2.0
Notable changes
rescheduleAftervariation of the command as it is now only used in test and it would be better to cancel and reschedule the workers explicitly.Testing guidance
Additional work checklist