Skip to content

Fix card monitor restart after polling error - #50

Merged
djwok merged 2 commits into
mainfrom
fix/card-monitor-restart-after-error
Jul 23, 2026
Merged

Fix card monitor restart after polling error#50
djwok merged 2 commits into
mainfrom
fix/card-monitor-restart-after-error

Conversation

@djwok

@djwok djwok commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Clear card-monitor state immediately on polling/transport error so startCardMonitor with the same options starts a new loop instead of no-oping while async onCardMonitorError delivery is still pending (Android + iOS).
  • Gate async error delivery on the post-termination generation so a newer start/stop does not receive a stale failure from the previous session.
  • Bump package version to 0.2.2.

Test plan

  • Unit tests: pnpm test
  • On device: start monitoring, induce a genuine Reader polling/transport failure, confirm one onCardMonitorError
  • Immediately call startCardMonitor with the same options after that failure; confirm a new monitor loop runs (presence/removal events resume)
  • Confirm explicit stopCardMonitor / autoStopAfterMs still emit no error
  • Confirm restarting before the async error is delivered does not emit a stale error against the new session

Made with Cursor

djwok and others added 2 commits July 23, 2026 13:54
Clear monitor state immediately on error termination so same-options startCardMonitor starts a new loop instead of no-oping while async error delivery is still pending.

Co-authored-by: Cursor <cursoragent@cursor.com>
Only deliver onCardMonitorError when the post-termination generation is still current, so a newer start/stop does not receive the previous session's failure.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@djwok
djwok merged commit d3e162b into main Jul 23, 2026
1 check passed
@djwok
djwok deleted the fix/card-monitor-restart-after-error branch July 23, 2026 05:02
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