Skip to content

feat: add event-driven auto backup triggers after wallet changes - #1377

Draft
sneurlax wants to merge 4 commits into
stagingfrom
feat/306-auto-backup-triggers
Draft

sneurlax wants to merge 4 commits into
stagingfrom
feat/306-auto-backup-triggers

Conversation

@sneurlax

Copy link
Copy Markdown
Member

Fire a debounced auto-backup when a transaction note is saved or an address book contact is created, edited, or deleted.

closes #306

@codecov

codecov Bot commented May 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.31325% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.97%. Comparing base (9ce80be) to head (57a425b).
⚠️ Report is 1 commits behind head on staging.

Files with missing lines Patch % Lines
...view/stack_backup_views/edit_auto_backup_view.dart 0.00% 39 Missing ⚠️
...gs_menu/backup_and_restore/create_auto_backup.dart 0.00% 31 Missing ⚠️
lib/services/auto_swb_service.dart 65.45% 19 Missing ⚠️
lib/utilities/prefs.dart 0.00% 13 Missing ⚠️
lib/services/address_book_service.dart 14.28% 6 Missing ⚠️
.../wallet_view/transaction_views/edit_note_view.dart 25.00% 3 Missing ⚠️
...roviders/global/address_book_service_provider.dart 25.00% 3 Missing ⚠️
.../sub_views/backup_frequency_type_select_sheet.dart 33.33% 2 Missing ⚠️
lib/utilities/format.dart 50.00% 2 Missing ⚠️
...ib/providers/global/auto_swb_service_provider.dart 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1377      +/-   ##
===========================================
+ Coverage    13.92%   13.97%   +0.04%     
===========================================
  Files         1139     1139              
  Lines       114707   114777      +70     
===========================================
+ Hits         15976    16035      +59     
- Misses       98731    98742      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sneurlax

Copy link
Copy Markdown
Member Author

Converting to draft because I have too many open PRs ready--will take another review pass over this before re-readying it

@sneurlax
sneurlax marked this pull request as draft August 20, 2026 18:58
@sneurlax
sneurlax force-pushed the feat/306-auto-backup-triggers branch from 16b6692 to 07d6fec Compare August 25, 2026 00:03
CI's format check runs over every .dart file a PR touches, so reformat
them up front instead of mixing the reflow into the feature diff.
Fire a debounced auto-backup when a transaction note is saved or an
address book contact is created, edited, or deleted, under a new
"After editing a note or contact" backup frequency.

AutoSWBService becomes provider-owned and takes its enabled/frequency
gate as a predicate that is re-evaluated when the debounce fires, so
turning auto backup off inside the debounce window cancels the pending
backup and an SWB restore cannot trigger a backup storm. Changes arriving
during an active backup queue a single follow-up instead of being dropped,
and timers and notifications are inert after disposal.

Rewriting the "default" self contact with identical data, which both
address book views do on every open, no longer counts as an edit.

closes #306
@sneurlax
sneurlax force-pushed the feat/306-auto-backup-triggers branch from 07d6fec to f3bfdef Compare October 13, 2026 16:24
Preserve current staging fixes and validate the feature regression suites.

Preserved staging My Stack contact serialization/mutex and debounced backup hooks; identical contact writes still avoid backups.
@sneurlax

Copy link
Copy Markdown
Member Author

Refreshed against staging d29d84c66049 with a merge that preserves branch history.

Preserved staging My Stack contact serialization/mutex and debounced backup hooks; identical contact writes still avoid backups.

Validation: 20 focused tests passed; scoped Dart analysis reports no errors. git diff --check passes. Pushed the same commit 57a425b35c78 to cypherstack and github-cs.

Full app builds and device/platform end-to-end behavior were not exercised.

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.

Auto Backup Wallet After Changes

1 participant