feat: persist hardware activities - #1044
Conversation
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
f3f9a2c to
435d9b0
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
708cd21 to
794722a
Compare
ea9a252 to
5ae816a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
0d7d218 to
15b80fa
Compare
This comment was marked as outdated.
This comment was marked as outdated.
15b80fa to
b4bbc26
Compare
I rebuilt the branch from current Resolved in b4bbc26 |
|
There are some conflicts that would be good to resolve before testing. |
29f2195 to
64cf108
Compare
I rebased this branch onto current Resolved in 64cf108 |
jvsena42
left a comment
There was a problem hiding this comment.
Review — wallet-scoped hardware activity
Reviewed the diff and ran the feature end-to-end on a Pixel 9 / Android 17 AVD with the deterministic T2T1 Bridge emulator (TREZOR_BRIDGE=true TREZOR_BRIDGE_URL=http://10.0.2.2:21325), against the staging regtest backend.
The design holds up. Verified working on device:
| Check | Result |
|---|---|
| Pairing → home tile, balance, blue rows | ✅ |
| Two receives with distinct amounts (12 345 / 5 712) | ✅ each rendered once |
Same txid in both scopes (trezor:… Received + bitkit Sent) |
✅ both rows, no collision |
| Tag on a hardware activity, persists across re-navigation | ✅ activity_tags row written with wallet_id = trezor:8df6… |
| Explore → INPUT + OUTPUTS(2) | ✅ 46 transaction_details rows persisted in the HW scope |
| Tag filter in All Activity | ✅ only the tagged blue row survives |
| Sent / Received / Other / All tabs | ✅ |
| Transfer To Spending (25% → 4 device approvals) | ✅ exactly one blue Transfer / From Savings, detail shows TO SPENDING |
| Restart with device disconnected | ✅ history + balance restored from Core, no duplicates (GROUP BY wallet_id, tx_id HAVING count>1 → empty) |
Not exercised: device removal → re-pair (covered by unit tests), CJIT/boost paths.
One blocker, in TransferRepo.markActivityAsTransfer — the new search = txid lookup can never match, which silently kills transfer-marking for the default wallet as well as hardware. Details and evidence in the inline thread. Two 🟠 items (backup tag asymmetry, emit under mutex) are worth resolving before merge; the rest are follow-ups or nits.
Conventions are otherwise clean: the runSuspendCatching migration, the System.currentTimeMillis() → nowTimestamp() swap, quoted log parameters, @Stable on ActivityDetailUiState, and extracting reconcileWatchers/toWatcherSpecs out of the nested collect are all improvements. Test coverage is genuinely good — the only visible gap maps exactly to the blocker.
b8ef428 to
e22a8d3
Compare
Closes #1029
Refs #998
Description
This PR:
bitkit-coreunder the wallet ID already derived and stored bymaster.bitkit-coreactivity model and the existingHwWalletId/KnownDeviceidentity path across watcher events, navigation, detail loading, tags, seen state, boost relationships, and deletion.Transfer / From Savingsrow represents the funding transaction.Preview
No visual redesign. Home, All Activity, Activity Detail, tag filtering, and Explore now render the wallet-scoped hardware activities supplied by
bitkit-core.QA Notes
Manual Tests
Transfer / From Savingsrow and its detail showsTO SPENDING.regression:app on-chain and LN activity → Activity Detail, tags, Explore, and wallet-specific lists: behavior matchesmaster.Automated Checks
HwWalletRepoTest.kt,ActivityRepoTest.kt, andTransferRepoTest.ktActivityDetailViewModelTest.kt,ActivityListViewModelTest.kt,AppViewModelSendFlowTest.kt, andTransferViewModelTest.ktNotifyPaymentReceivedHandlerTest.ktandBoostTransactionViewModelTest.ktactivity-blue-icons.xmlandtransfer-to-spending.xml;activity-detail-hw-tags.xmladds persisted tag and inputs/outputs coverage.just compile,just test, andjust lintpassed; all hardware-wallet journey XML files passedxmllint.