Skip to content

Add VSS backup for all categories#206

Merged
ben-kaufman merged 3 commits intomasterfrom
feat/backup-all-categories
Nov 6, 2025
Merged

Add VSS backup for all categories#206
ben-kaufman merged 3 commits intomasterfrom
feat/backup-all-categories

Conversation

@ben-kaufman
Copy link
Contributor

@ben-kaufman ben-kaufman commented Nov 6, 2025

This PR adds support for wallet, metadata, blocktank, activity, and lightning connections categories for VSS backups, and fixes issues from the previous VSS backup PR.

Screen.Recording.2025-11-06.at.10.26.57.AM.mov

@jvsena42 jvsena42 requested a review from Copilot November 6, 2025 16:17
Copy link
Contributor

Copilot AI left a 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 adds comprehensive VSS backup support for wallet, metadata, blocktank, activity, and lightning connections categories. The changes consolidate backup configuration, refactor SettingsStore functionality into SettingsViewModel, introduce reactive publishers for state changes, and implement backup/restore operations for all data categories.

Key Changes:

  • Consolidated backup configuration into SettingsBackupConfig for better maintainability
  • Merged SettingsStore into SettingsViewModel with reactive publishers for backup triggers
  • Added backup/restore support for wallet, metadata, blocktank, and activity categories
  • Implemented change detection publishers in core services to trigger backups automatically

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
BackupSettings.swift Refactored color logic into BackupViewModel helper methods
SettingsViewModel.swift Merged SettingsStore functionality, added KVO observers and publishers for backup triggers
BlocktankViewModel.swift Added state change notifications after data modifications
BackupViewModel.swift Added helper methods for status color determination
WidgetsBackupConverter.swift Simplified position value parsing logic
TransferStorage.swift Made singleton, added change publisher, exposed getAll() method
TransferService.swift Updated to use TransferStorage singleton
SettingsStore.swift Deleted entire file (functionality moved to SettingsViewModel)
ServiceQueue.swift Added dedicated backup queue
LightningService.swift Added sync status change publisher
CoreService.swift Added change publishers and upsert methods for activities and blocktank data
BackupService.swift Implemented backup/restore for all categories, replaced NotificationCenter with Combine
SettingsBackupConfig.swift New configuration file for backup settings
BackupPayloads.swift New models for backup data structures
BackupCategory.swift Renamed ldkActivity to activity, removed slashtags
AppScene.swift Updated to use SettingsViewModel singleton and Combine publishers
Package.resolved Updated bitkit-core dependency

Copy link
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ovitrif
Copy link
Collaborator

ovitrif commented Nov 6, 2025

nit: Keeping the logging a bit consistent between the 2 platforms would help us be able to reuse our debugging skills in PROD from iOS to Android.

What I try to say is that the logging that got removed in this PR but were added in the previous one, were fine to remain IMHO.

ovitrif
ovitrif previously approved these changes Nov 6, 2025
Copy link
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 🟢

  • Transfer back to savings without 6 block confirmations
  • Backup & restore
  • expect transfer pending balance

@ovitrif
Copy link
Collaborator

ovitrif commented Nov 6, 2025

@ben-kaufman I approved the PR because I consider it a valid step forward which doesn't break stuff; but I would still expect the relevant comments to be resolved, either in next PR or here 🙏🏻

@ben-kaufman
Copy link
Contributor Author

I've already pushed for the comment on LDK sync here, I'll update the logs in another PR then

Copy link
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reapproved
⚠️ not retested

@ovitrif
Copy link
Collaborator

ovitrif commented Nov 6, 2025

Tested 🟢

  • Transfer back to savings without 6 block confirmations
  • Backup & restore
  • expect transfer pending balance

Reran Test: 🟢 ✔️

@ben-kaufman :shipit:

@ben-kaufman ben-kaufman merged commit 726f36b into master Nov 6, 2025
5 checks passed
@ben-kaufman ben-kaufman deleted the feat/backup-all-categories branch November 6, 2025 18:55
@MainActor
class SettingsViewModel: ObservableObject {
class SettingsViewModel: NSObject, ObservableObject {
static let shared = SettingsViewModel()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By turning this view model into a singleton there is now a lifecycle issue when wiping the app (in AppReset.swift). The singleton will keep pre-wipe state and any observers may behave in unexpected ways. Solution would be to either revert this to a instance-based object or add any needed reset() methods and call them when wiping the app.

BitcoinErrorLog pushed a commit to BitcoinErrorLog/bitkit-ios that referenced this pull request Dec 15, 2025
…egories

Add VSS backup for all categories
BitcoinErrorLog pushed a commit to BitcoinErrorLog/bitkit-ios that referenced this pull request Feb 7, 2026
…egories

Add VSS backup for all categories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants