Skip to content

Implement a modernized, modular backup and restore system (v3) using …#1039

Merged
theovilardo merged 1 commit intomasterfrom
impl/backup-and-restore-new
Feb 12, 2026
Merged

Implement a modernized, modular backup and restore system (v3) using …#1039
theovilardo merged 1 commit intomasterfrom
impl/backup-and-restore-new

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

…a new .pxpl file format (ZIP-based) and robust validation pipelines.

  • New Backup System (v3):

    • Replaces the legacy GZIP format with a ZIP-based structure containing a manifest.json and individual module JSON files.
    • Introduces BackupManager, BackupWriter, and BackupReader to handle the new format while maintaining backward compatibility for v1/v2 backups via LegacyPayloadAdapter.
    • Adds BackupSection to define exportable modules, including new support for Artist Images, Equalizer Presets, and QuickFill Genres.
  • Validation & Security:

    • Implements a multi-stage ValidationPipeline including file-level checks (size, extension), ZIP safety (path traversal, zip bomb protection), manifest integrity, and SHA-256 checksum verification for module payloads.
    • Adds ModuleSchemaValidator and ContentSanitizer to ensure imported data meets structural and security requirements.
  • Restore Improvements:

    • Adds a "transactional" restore process in RestoreExecutor with snapshot-based rollback capabilities to prevent data corruption on partial failures.
    • Introduces a "Restore Plan" phase that allows users to inspect backup metadata (device info, app version, module sizes) and select specific modules before importing.
  • UI & UX:

    • Completely overhauled the Import UI in SettingsCategoryScreen with a multi-step flow: file selection, backup inspection, and module-specific configuration.
    • Implements a Backup History system in BackupHistoryRepository to track and quickly re-import recent backup files.
    • Enhanced progress reporting for both export and import operations with detailed step descriptions.
  • Data & Persistence:

    • Updates UserPreferencesRepository to improve type safety and fallback logic during preference restoration.
    • Adds specialized BackupModuleHandler implementations for all data types (Playlists, Favorites, Lyrics, Stats, etc.) to encapsulate serialization logic.
    • Deprecates the old AppDataBackupManager.

…a new `.pxpl` file format (ZIP-based) and robust validation pipelines.

- **New Backup System (v3)**:
    - Replaces the legacy GZIP format with a ZIP-based structure containing a `manifest.json` and individual module JSON files.
    - Introduces `BackupManager`, `BackupWriter`, and `BackupReader` to handle the new format while maintaining backward compatibility for v1/v2 backups via `LegacyPayloadAdapter`.
    - Adds `BackupSection` to define exportable modules, including new support for **Artist Images**, **Equalizer Presets**, and **QuickFill Genres**.

- **Validation & Security**:
    - Implements a multi-stage `ValidationPipeline` including file-level checks (size, extension), ZIP safety (path traversal, zip bomb protection), manifest integrity, and SHA-256 checksum verification for module payloads.
    - Adds `ModuleSchemaValidator` and `ContentSanitizer` to ensure imported data meets structural and security requirements.

- **Restore Improvements**:
    - Adds a "transactional" restore process in `RestoreExecutor` with snapshot-based rollback capabilities to prevent data corruption on partial failures.
    - Introduces a "Restore Plan" phase that allows users to inspect backup metadata (device info, app version, module sizes) and select specific modules before importing.

- **UI & UX**:
    - Completely overhauled the Import UI in `SettingsCategoryScreen` with a multi-step flow: file selection, backup inspection, and module-specific configuration.
    - Implements a **Backup History** system in `BackupHistoryRepository` to track and quickly re-import recent backup files.
    - Enhanced progress reporting for both export and import operations with detailed step descriptions.

- **Data & Persistence**:
    - Updates `UserPreferencesRepository` to improve type safety and fallback logic during preference restoration.
    - Adds specialized `BackupModuleHandler` implementations for all data types (Playlists, Favorites, Lyrics, Stats, etc.) to encapsulate serialization logic.
    - Deprecates the old `AppDataBackupManager`.
@theovilardo theovilardo merged commit 539b18b into master Feb 12, 2026
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.

1 participant