Skip to content

fix(android): apply CodeRabbit review on pure-ML Kit QR scanner - #4

Merged
Chloemlla merged 1 commit into
mainfrom
chore/coderabbit-mlkit-feedback
Aug 12, 2026
Merged

fix(android): apply CodeRabbit review on pure-ML Kit QR scanner#4
Chloemlla merged 1 commit into
mainfrom
chore/coderabbit-mlkit-feedback

Conversation

@Chloemlla

Copy link
Copy Markdown
Owner

Summary

Applies the actionable CodeRabbit comments from #3 to QrScannerView.kt:

  • Restrict to QR format — build the ML Kit client with BarcodeScannerOptions.Builder().setBarcodeFormats(Barcode.FORMAT_QR_CODE). Faster, matches the PiliPlus decoder/activity behavior.
  • Full teardown — a disposed flag guards the async cameraProviderFuture listener so binding never happens after disposal; onDispose now clears the analyzer, unbinds CameraX, closes the scanner and shuts down the analysis executor (previously only the executor was shut down).
  • Close on synchronous throwInputImage.fromMediaImage / scanner.process are wrapped so an exception still closes the ImageProxy instead of leaking it.

Note on release verification (CodeRabbit #1)

No device available in this environment. Unit tests + lint + release APK already pass on the merged head (ac8da0a, run 31609960628 exit 0); a real-device camera smoke test remains a manual step.

Test plan

  • PiliPlus uses the identical scanner/teardown pattern and its release APK build passes.
  • CI on this PR runs flutter analyze and the release APK build.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Chloemlla, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1e09e893-98b9-463d-97b2-d3bececed222

📥 Commits

Reviewing files that changed from the base of the PR and between ac8da0a and 3cab3d5.

📒 Files selected for processing (1)
  • android/app/src/main/java/com/chloemlla/synapse/mobile/ui/QrScannerView.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Restrict ML Kit scanning to QR format via BarcodeScannerOptions.
- Add full teardown: disposed flag guards the async bind listener from
  post-disposal execution; onDispose clears the analyzer, unbinds CameraX,
  closes the scanner and shuts down the analysis executor.
- Close the ImageProxy when InputImage creation or processing throws
  synchronously instead of leaking it.
@Chloemlla
Chloemlla merged commit 740775c into main Aug 12, 2026
3 checks passed
@Chloemlla
Chloemlla deleted the chore/coderabbit-mlkit-feedback branch August 13, 2026 00:57
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