[PR #6687] [PM-23560] bug: Added guard to ensure duplicate scan events are not fired #12930

Closed
opened 2026-04-11 03:53:56 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6687

State: closed
Merged: Yes


🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-23560

📔 Objective

When scanning QR code totp items, multiples are being added, this is caused by QrCodeAnalyzer firing onQrCodeScanned every time it gets a result.
In order to avoid adding multiple items, a check on ViewModel was added in order to only allow the first result to be returned.
On some cases, if the image is analyzed right after opening the screen, the EventsEffect have not been initiated and the user is not being returned to be previous screen. To workaround that scenario, when the code has been scanned, we do not emit the code again but fire a NavigateBack event.

Same scenario was happening on PasswordManager, despite not creating multiple items, multiple events were fired.

**Original Pull Request:** https://github.com/bitwarden/android/pull/6687 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-23560 ## 📔 Objective When scanning QR code totp items, multiples are being added, this is caused by `QrCodeAnalyzer` firing `onQrCodeScanned` every time it gets a result. In order to avoid adding multiple items, a check on ViewModel was added in order to only allow the first result to be returned. On some cases, if the image is analyzed right after opening the screen, the `EventsEffect` have not been initiated and the user is not being returned to be previous screen. To workaround that scenario, when the code has been scanned, we do not emit the code again but fire a NavigateBack event. Same scenario was happening on PasswordManager, despite not creating multiple items, multiple events were fired.
GiteaMirror added the pull-request label 2026-04-11 03:53:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12930