woocommerce-android
woocommerce-android copied to clipboard
[Woo POS] We don't handle the low battery event during IPP flow properly
Closes: #12565
Description
Discussed in Slack.
This PR addresses the issue where a LOW_BATTERY event incorrectly shows a toast and an empty dialog instead of triggering the appropriate low battery warning dialog similar to the LOW_BATTERY_SUCCEED_CONNECT event.
The underlying problem was that LOW_BATTERY events were causing the bluetoothReaderListener to be reset to an Unknown state before the low battery event could be appropriately handled as Failed.
Steps to reproduce
- Go to POS.
- Connect to virtual card reader in low battery state
ORphysical card reader that's low on battery. - Observe the behavior. Previously, it would show a toast and reset to an unknown state.
- With the fix, it should now display the low battery warning dialog correctly.
Testing information
- Devices used: tablet emulator and physical tablet/card reader
- Workflow tested: Initiated a reader connection and simulated low battery events during the update process.
- Affected areas: Card reader connection workflow, software update process.
The tests that have been performed
- Verified that
LOW_BATTERYtriggers the correct dialog. - Confirmed the state transitions are handled correctly without prematurely resetting to
Unknown. - Checked no regressions occur in
LOW_BATTERY_SUCCEED_CONNECT.
-
[x] I have considered if this change warrants release notes and have added them to
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes. -
[ ] I have Removed any TEST CODE.
Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:
- [ ] The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
- [ ] Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
- [ ] Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.
| 1 Message | |
|---|---|
| :book: | This PR is still a Draft: some checks will be skipped. |
Generated by :no_entry_sign: Danger
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
| App Name | WooCommerce-Wear Android | |
| Platform | ⌚️ Wear OS | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | afcb619fda13a053cd462469fad78448c9744ca6 | |
| Direct Download | woocommerce-wear-prototype-build-pr12568-afcb619.apk |
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
| App Name | WooCommerce Android | |
| Platform | 📱 Mobile | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | afcb619fda13a053cd462469fad78448c9744ca6 | |
| Direct Download | woocommerce-prototype-build-pr12568-afcb619.apk |
Codecov Report
Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
Project coverage is 40.58%. Comparing base (
56404b5) to head (afcb619). Report is 1108 commits behind head on trunk.
Additional details and impacted files
@@ Coverage Diff @@
## trunk #12568 +/- ##
============================================
- Coverage 40.58% 40.58% -0.01%
Complexity 5674 5674
============================================
Files 1229 1229
Lines 69287 69289 +2
Branches 9579 9581 +2
============================================
- Hits 28119 28118 -1
- Misses 38584 38586 +2
- Partials 2584 2585 +1
| Flag | Coverage Δ | |
|---|---|---|
40.58% <0.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.