Skip to content

Add continuous Reader scanning and lifecycle cleanup - #51

Merged
djwok merged 2 commits into
mainfrom
codex/fix-continuous-reader-scan-cleanup
Jul 29, 2026
Merged

Add continuous Reader scanning and lifecycle cleanup#51
djwok merged 2 commits into
mainfrom
codex/fix-continuous-reader-scan-cleanup

Conversation

@djwok

@djwok djwok commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add optional continuous Reader scanning while preserving bounded scans by default
  • emit discovered Readers through the existing real-time discovery listener until explicit stop or connection
  • clean up Android scan, card-monitor, Card, and Reader resources when the module or owning activity is destroyed
  • document the new scan lifecycle and add Android native source-contract regressions

Root cause

Android divided a five-second scan across five ACS Reader models, leaving roughly one second per model. ACR1555U discovery was unreliable in that window. Android also retained native ACS resources across app teardown, which could leave the Reader connected and no longer advertising after reopening.

Continuous mode gives each Reader model the configured timeoutMs dwell and keeps rotating until stopReaderScan() or connectReader() ends the scan. Android lifecycle cleanup is idempotent and best-effort because teardown cannot report failures to JavaScript.

Validation

  • pnpm test -- --runInBand --watchman=false — 42 tests passed
  • pnpm exec tsc --noEmit
  • pnpm lint
  • pnpm build
  • pnpm --dir example exec tsc --noEmit
  • Android :app:assembleDebug — successful
  • Swift frontend parse — successful
  • git diff --check

Full iOS workspace compilation remains blocked by stale CocoaPods paths in the example workspace before this module compiles. No real-device or ADB testing was performed.

@djwok
djwok marked this pull request as ready for review July 29, 2026 09:28
@cursor

cursor Bot commented Jul 29, 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 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

check and confirm no issues

@djwok
djwok merged commit 45695a8 into main Jul 29, 2026
1 check passed
@djwok
djwok deleted the codex/fix-continuous-reader-scan-cleanup branch July 29, 2026 09:38
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