-
Notifications
You must be signed in to change notification settings - Fork 1
feat: restore LSP data and use bulk upsert APIs #453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the bitkit-core-android dependency to version 0.1.22 and adds support for closed channels in backup/restore operations. The changes improve error handling consistency and add missing data structures.
Key changes:
- Upgraded bitkit-core-android from 0.1.18 to 0.1.22
- Added closed channels support to activity backup/restore flow
- Improved error logging consistency in TransferViewModel
- Added backup state management to BackupNavSheetViewModel with proper health check integration
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Upgrades bitkit-core-android dependency to 0.1.22 |
| app/src/main/java/to/bitkit/viewmodels/TransferViewModel.kt | Refactors error logging to use consistent pattern with .also |
| app/src/main/java/to/bitkit/ui/settings/backups/MetadataScreen.kt | Adds null safety for lastBackupTimeMs and error handling with fallback display |
| app/src/main/java/to/bitkit/ui/settings/backups/BackupNavSheetViewModel.kt | Implements backup state collection from HealthRepo and CacheStore |
| app/src/main/java/to/bitkit/ui/screens/wallets/activity/utils/PreviewItems.kt | Adds boostTxIds field to preview items |
| app/src/main/java/to/bitkit/ui/screens/wallets/activity/components/ActivityIcon.kt | Adds boostTxIds field to preview items |
| app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityExploreScreen.kt | Adds boostTxIds field to preview items |
| app/src/main/java/to/bitkit/ui/screens/wallets/activity/ActivityDetailScreen.kt | Adds boostTxIds field to preview items |
| app/src/main/java/to/bitkit/services/CoreService.kt | Adds closed channel methods, batch operations, and removes Random.Default usage |
| app/src/main/java/to/bitkit/repositories/BlocktankRepo.kt | Adds restoreFromBackup method for Blocktank data restoration |
| app/src/main/java/to/bitkit/repositories/BackupRepo.kt | Refactors restore operations to use batch methods and handle closed channels |
| app/src/main/java/to/bitkit/repositories/ActivityRepo.kt | Adds closed channels support and restoreFromBackup method |
| app/src/main/java/to/bitkit/models/BackupPayloads.kt | Adds closedChannels field to ActivityBackupV1 |
| app/src/main/java/to/bitkit/data/dao/TransferDao.kt | Adds batch upsert method for transfers |
| app/src/main/java/to/bitkit/data/dao/TagMetadataDao.kt | Adds batch upsert method for tag metadata |
Comments suppressed due to low confidence (2)
app/src/main/java/to/bitkit/repositories/BackupRepo.kt:411
- The Logger.debug call is missing the
contextparameter. It should includecontext = TAGfor consistency with other logging statements in this file and to follow the project's logging pattern.
Logger.debug("Restored caches and ${parsed.tagMetadata.size} tags metadata records", TAG)
app/src/main/java/to/bitkit/repositories/BackupRepo.kt:416
- The Logger.debug call is passing TAG as the second positional parameter instead of using the named
contextparameter. It should beLogger.debug(\"...\", context = TAG)for consistency with the project's logging pattern.
Logger.debug("Restored ${parsed.orders.size} orders, ${parsed.cjitEntries.size} CJITs", TAG)
jvsena42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reproduced test suggestions on emulator
Completes Roadmap item: Backup & Restore
Description
This PR:
Preview
I didn't include preview for test 1️⃣ because it takes 2 to 4 minutes to wait, but it worked for me successfully as described under 'QA Notes'.
lastBackupTime.mp4
QA Notes
1️⃣ Test restore BT state from backup
/regtest mine"Refreshing blocktank orders…"2️⃣ Test last backup time