feat(categories): categoryBackupService pre-migration SREF wrapper (#120) #124
No reviewers
Labels
No labels
source:analyste
source:defenseur
source:human
source:medic
status:approved
status:blocked
status:in-progress
status:needs-fix
status:ready
status:review
status:triage
type:bug
type:feature
type:infra
type:refactor
type:schema
type:security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: maximus/Simpl-Resultat#124
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-120-category-backup-service"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #120
Livraison 2 — filet de sécurité obligatoire avant la migration v2→v1.
src/services/categoryBackupService.ts<ProfileName>_avant-migration-<ISO8601>.sref(sanitisé,:→-pour Windows)~/Documents/Simpl-Resultat/backups/(créé si manquant)BackupErroravec codes) — à mapper en clés i18n côté UIensure_backup_dir,get_file_sizeBuild + type-check + tests existants (133 vitest + 34 cargo) passent.
Review verdict: APPROVE
Security
crypto.subtle.digest) — validates logical integrity end-to-end including encryption/decryption.BackupError.detail.sanitizeProfileNamestrips\/:*?"<>|+ control chars + trailing dots, collapses whitespace, caps at 80 chars, falls back to"profile"for empty/./..inputs. The filename is joined to a trusted directory path so traversal cannot escape the backups dir.:→-, fractional seconds removed).Correctness
read_import_file(which decrypts if needed), re-parses the envelope, and compares SHA-256 of both payloads.throw BackupErrorwith stablecode+ detail — nothing swallowed.missing_passwordbefore any write.null(won't trigger encryption path inwrite_export_file).write_export_fileerrors mapped to stable codes (disk_space,permission_denied,write_failed).Quality
any.ensure_backup_dir,get_file_size) — no modification of existing commands.Data
dataExportServicehelpers).Build / Tests
cargo check✓cargo test→ 34 passed ✓npm run build(tsc + vite) ✓npm test→ 133 passed ✓Ready to be consumed by #121 (migration page).