Skip to content

fix: recover from stale capture locks - #17

Merged
yahorbarkouski merged 1 commit into
mainfrom
codex/issue-5-capture-lock-recovery
Mar 29, 2026
Merged

fix: recover from stale capture locks#17
yahorbarkouski merged 1 commit into
mainfrom
codex/issue-5-capture-lock-recovery

Conversation

@yahorbarkouski

Copy link
Copy Markdown
Owner

Summary

  • replace the scheduler's promise lock with an expiring timed lease so scheduled captures skip safely and manual captures only wait up to the lease timeout
  • add matching stale in-flight recovery to activity-window candidate capture so window finalization cannot block forever behind a hung screenshot
  • add regression coverage for stale manual captures, scheduled retry after timeout, and activity-window recovery

Testing

  • npm test -- electron/main/features/scheduler/tests/SchedulerService.test.ts electron/main/features/activityWindow/tests/ActivityWindowService.test.ts
  • npm run typecheck
  • npx biome check electron/main/infra/async/timedLease.ts electron/main/features/scheduler/SchedulerService.ts electron/main/features/activityWindow/ActivityWindowService.ts electron/main/features/scheduler/tests/SchedulerService.test.ts electron/main/features/activityWindow/tests/ActivityWindowService.test.ts

Closes #5

@yahorbarkouski
yahorbarkouski force-pushed the codex/issue-5-capture-lock-recovery branch from 6ad59df to 2a49bf1 Compare March 29, 2026 11:42
@yahorbarkouski
yahorbarkouski merged commit 3fa1c02 into main Mar 29, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capture scheduler hangs indefinitely when capture operation stalls

1 participant