You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/011-database-backup-system/spec.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ A user wants to see which node backups exist, how much space they consume, and o
69
69
-**FR-001**: The system MUST automatically create a backup of the current node's database state when the user initiates a connection to a different node.
70
70
-**FR-002**: The system MUST automatically restore a previously backed-up database state when the user reconnects to a node that has an existing backup.
71
71
-**FR-003**: The system MUST identify nodes uniquely to associate backups correctly.
72
-
-**FR-004**: The system MUST handle backup failures gracefully without blocking the node switch.
72
+
-**FR-004**: The system MUST retry a failed backup/restore once automatically; if the retry also fails, skip with a non-blocking toast warning and proceed with the node connection.
73
73
-**FR-005**: The system MUST provide a UI for viewing and managing existing backups.
74
74
-**FR-006**: The system MUST handle the case where no backup exists for a connecting node (proceed normally).
75
75
-**FR-007**: The system MUST ensure data integrity of backups (detect corruption).
@@ -102,4 +102,12 @@ A user wants to see which node backups exist, how much space they consume, and o
102
102
103
103
### Session 2026-05-22
104
104
105
-
- Q: What is the backup granularity — full database snapshot or per-node filtered data? → A: Full SQLite file snapshot (the DB only ever contains one node's data at a time; it clears previous node data before connecting a new one).
105
+
1.**Backup scope** — Q: What is the backup granularity — full database snapshot or per-node filtered data? → A: Full SQLite/SwiftData file snapshot. The DB only ever contains one node's data at a time (previous node data is cleared before connecting a new one).
106
+
107
+
2.**Backup trigger** — Q: When exactly does the backup happen relative to the node-switch flow? → A: Immediately before the DB is cleared for the new node connection. The clear is blocked until the snapshot completes (synchronous gate).
108
+
109
+
3.**Retention policy** — Q: How many backups are kept per node? → A: One (1:1 node-to-backup mapping). Each new backup for a given node replaces the previous one.
110
+
111
+
4.**Restore UX** — Q: How is the user informed when a restore happens? → A: Fully automatic and silent. A brief non-blocking toast/indicator is shown (e.g., "Restored Node A data") but no user action is required.
112
+
113
+
5.**Error handling** — Q: What happens when a backup or restore operation fails? → A: Retry once automatically. If the retry also fails, silently skip with a brief toast warning; the node connection proceeds regardless. Failed backups will be retried on the next node switch.
0 commit comments