Skip to content

fix: enable background and foreground cipher search processing - #122

Merged
samdaw13 merged 1 commit into
mainfrom
fix/enable-background-and-foreground-processing
Mar 11, 2026
Merged

samdaw13 merged 1 commit into
mainfrom
fix/enable-background-and-foreground-processing

Conversation

@samdaw13

@samdaw13 samdaw13 commented Mar 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fixes crib search stopping when the app is backgrounded on Android
  • Root cause: setTimeout chains scheduled from the main JS context get suspended by Android when the app loses focus. Only code running inside the BackgroundService.start() task callback stays alive.
  • Moved cribSearchAsync to run inside the background task callback so the search continues reliably in the background
  • Decoupled isCancelled from BackgroundService.isRunning() to prevent false cancellations

Test plan

  • Start a crib search on Android
  • Background the app — notification should continue updating progress
  • Return to the app — results should display when complete
  • Cancel a search mid-progress — should stop cleanly
  • Run all unit tests (npm test) — 132 tests pass

🤖 Generated with Claude Code

…round processing

setTimeout chains scheduled from the main JS context get suspended when the
app is backgrounded on Android. Moving cribSearchAsync inside the
BackgroundService task callback ensures the search continues running when the
app is not in focus. Also simplified isCancelled to only check the cancelled
flag rather than coupling it to BackgroundService.isRunning().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@samdaw13
samdaw13 enabled auto-merge March 11, 2026 19:09
@samdaw13
samdaw13 merged commit 07de203 into main Mar 11, 2026
2 checks passed
@samdaw13
samdaw13 deleted the fix/enable-background-and-foreground-processing branch March 11, 2026 19:09
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