-
Notifications
You must be signed in to change notification settings - Fork 1
feat: all backup categories #452
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 implements the remaining wallet data backup categories to complete the backup system for v1. The main purpose is to back up all wallet metadata and activity data to enable full wallet restoration from the cloud.
- Implements 4 new backup categories: WALLET, METADATA, BLOCKTANK, ACTIVITY, and LIGHTNING_CONNECTIONS (display-only)
- Renames LDK_ACTIVITY to ACTIVITY and comments out SLASHTAGS/contacts for v1 scope
- Uses JSON serialization with versioned payloads for maintainability and cross-version compatibility
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/java/to/bitkit/models/BackupPayloads.kt | New versioned payload data classes for serialization |
| app/src/main/java/to/bitkit/repositories/BackupRepo.kt | Core backup/restore implementation for all categories with change detection |
| app/src/main/java/to/bitkit/repositories/ActivityRepo.kt | Adds activity change notifications and upsert functionality |
| app/src/main/java/to/bitkit/models/BackupStatus.kt | Updates backup category enum, comments out SLASHTAGS |
| app/src/main/java/to/bitkit/viewmodels/BackupsViewModel.kt | Disables manual retry on from LIGHTNING_CONNECTIONS instead of ACTIVITY |
| app/src/main/java/to/bitkit/services/CoreService.kt | Adds upsert method to ActivityService |
| app/src/main/java/to/bitkit/data/dao/TransferDao.kt | Adds getAll() and observeAll() methods for backup |
| app/src/main/java/to/bitkit/data/dao/TagMetadataDao.kt | Adds observeAll() method for change detection |
| app/src/main/java/to/bitkit/data/entities/TagMetadataEntity.kt | Adds @serializable annotation |
| Minor files | Test updates, formatting fixes, and documentation improvements |
81de443 to
a8658c7
Compare
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.
Very nice work!
Could considerr using IODispather on BackupRepository because of the network calls, DB reading and the amount of jobs (7 data listeners + 6 status observers)
Thank you sir 🙌🏻 Optimizing by using |
Roadmap: Backup & Restore
Description
This PR implements the remaining wallet (meta) data backups, namely the backup categories:
It also comments out SLASHTAGS/contacts backup category to reflect its out-of-scope status for v1 release.
Aside
This PR also refactors
bip21state management, mainly to make the code easier to reason about and to make intentions more explicit in the code, most notable changes:ChannelReady&ChannelClosedevents, instead only mutatebolt11as needed:ChannelReadyaddbolt11if transitioning from cannot-receive → can-receiveChannelClosedremovebolt11if transitioning from can-receive → cannot-receiverefreshBip21and call it only when the intention is to run all its operationsPaymentReceivedonlyrefreshAddressIfNeededandupdateBip21Url, do not reset amount or description.Note
Restoring blocktank data (orders, cjits, info) is handled in PR: #45.
Preview
QA Notes
2 Tests:
Backup starting for: 'ACTIVITY', etcRestore success for: 'ACTIVITY' - BackupRepo, etc