chore(deps): bump bitbox_flutter v0.0.5 → v0.0.7#469
Merged
Conversation
v0.0.7 introduces the public `installSimulatedBitboxPlatform` testing helper (lib/testing.dart) and ships matching plugin tests. The platform interface is API-compatible with v0.0.5 — only formatting changes on the abstract method signatures; no breaking changes for callers. This bump unblocks a follow-up PR that adds a BitboxService lifecycle suite driven by the official simulator instead of ad-hoc mocktail mocks.
Contributor
BitBox02 simulator checkHost: Firmware:
Summary: 15 total · 15 passed · 0 failed |
4 tasks
TaprootFreak
added a commit
that referenced
this pull request
May 20, 2026
#470) ## Summary Adds an eight-test `BitboxService` lifecycle suite that locks in the device-loss / re-attach semantics introduced by #461 and drives the same code paths the real plugin runs at runtime via the official `installSimulatedBitboxPlatform` helper. **Stacks on top of #469** (`chore(deps): bump bitbox_flutter v0.0.5 → v0.0.7`) — that bump is what exposes the simulator helper. Once #469 merges, this branch can be rebased onto `develop` cleanly. ## What's tested | Test | Closes drift on | |---|---| | `getCredentials before init returns disconnected credentials` | base behaviour contract | | `init() promotes credentials handed out before connect (P461 #1)` | pre-fix the wallet stayed disconnected forever after re-pair | | `observer clears credentials and closes transport when device vanishes` | Android USB FD release | | `observer preserves the credentials reference so reconnect can heal them` | the core P461 #1 fix — verified end-to-end with a vanish → reappear cycle | | `observer stops ticking after a single device-loss event` | self-cancel after recovery | | `observer swallows transport-close errors instead of crashing` | Android plugin can throw on close() if FD is gone | | `stopConnectionStatusObserver cancels the active periodic` | start/stop hygiene | | `startConnectionStatusObserver replaces any prior periodic` | no double-tick race on re-arm | ## Why the simulator (not mocktail) The bug class is in a `Timer.periodic` callback that calls into `BitboxManager.devices` and `BitboxManager.disconnect()`. Mocking `BitboxService` itself loses the bug; mocking `BitboxManager` adds drift risk every time the plugin grows. `installSimulatedBitboxPlatform` is the plugin author's official testing seam — it stubs `BitboxUsbPlatform.instance` so the real `BitboxManager` runs against an in-process fake. Adding new scenarios (delays, errors, custom device lists) is a one-liner via `platform.throwOn(...)` / `platform.when(...)`. ## Tiny production-code change `BitboxService` gains an optional ctor parameter: ```dart BitboxService({Duration connectionStatusInterval = const Duration(seconds: 5)}) ``` Default is unchanged (5 s) so `lib/setup/di.dart` keeps the no-arg constructor it has today. Tests use 50 ms so the periodic can be exercised in real time without `fakeAsync` gymnastics. ## Verification - `flutter analyze lib/packages/hardware_wallet/ test/packages/hardware_wallet/` — clean - `flutter test test/packages/hardware_wallet/bitbox_service_test.dart` — 8/8 green - `flutter test test/packages/hardware_wallet/ test/screens/hardware_connect_bitbox/` — all green except one **pre-existing** failure on `develop` (`BitboxCredentials queue continues after a sign throws`) that's unrelated to this PR ## Test plan - [x] `flutter analyze` clean on touched files - [x] New suite green locally (8/8) - [x] Full BitBox test dirs green except the known pre-existing failure - [ ] CI green once #469 is merged + this PR rebased / marked ready
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure dependency bump of
bitbox_flutterfromv0.0.5tov0.0.7.v0.0.7 adds the public
installSimulatedBitboxPlatformtesting helper(lib/testing.dart) and ships matching plugin tests. The
BitboxUsbPlatformabstract interface is API-compatible with v0.0.5 —the diff is only formatting changes to method signatures; no breaking
changes for in-tree callers.
Why now
Unblocks a follow-up PR that replaces the current ad-hoc mocktail
BitBox mocks with the plugin's official simulator, enabling proper
service-lifecycle and observer-timer coverage.
Verification
flutter pub getresolves to v0.0.7 (pubspec.lockupdated).flutter analyzeonlib/packages/hardware_wallet/,lib/screens/hardware_connect_bitbox/, and matching test dirs —clean.
flutter test test/packages/hardware_wallet/ \ test/screens/hardware_connect_bitbox/ \ test/packages/service/wallet_service_test.dartOut of scope
Test plan
flutter pub getsucceedsflutter analyzeclean on BitBox-touching files