Skip to content

Fix WorkScheduler.schedule() to actually schedule work#168

Open
prjanitor wants to merge 1 commit intotylerbwong:masterfrom
prjanitor:prjanitor/6d1e74e9f9dce0644a09218f88c89a267d3077d9
Open

Fix WorkScheduler.schedule() to actually schedule work#168
prjanitor wants to merge 1 commit intotylerbwong:masterfrom
prjanitor:prjanitor/6d1e74e9f9dce0644a09218f88c89a267d3077d9

Conversation

@prjanitor
Copy link
Copy Markdown

Bug Description

The schedule() method in WorkScheduler was only calling workManager.cancelAllWork() but never actually scheduling any work. The scheduleNewWork() method existed with the correct logic but was never invoked.

Fix

Added a call to scheduleNewWork() after cancelAllWork() in the schedule() method. This ensures that:

  1. All existing work is canceled (clean slate)
  2. The configured work requests are actually scheduled

Files Changed

  • app/src/main/kotlin/me/tylerbwong/stack/data/work/WorkScheduler.kt

Testing

This fix ensures that background work (bookmarks sync, sites sync) will actually be scheduled when schedule() is called.


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

The schedule() method was only canceling all work but never calling
scheduleNewWork() to schedule the configured work requests. This means
no background work would ever be scheduled.
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