Skip to content

Proposal: Stateful "Smart Sync" and Automated Startup Logic #5

@kanjieater

Description

@kanjieater

Problem Statement
The current implementation is "stateless," requiring users to manually decide between "Push" and "Pull." This relies on the user remembering which device has the most recent save data. If a user accidentally pulls an old revision over a newer local save, data is permanently lost.

Proposed Solution
Transform the app into a stateful sync manager. By tracking the sync history for each title, the app can automatically determine whether to Push, Pull, or flag a Conflict.

Technical Implementation

  1. Sync State Tracking (sync_state.ini)
    Maintain a local metadata file to store the following for each Title ID:

    • last_revision_id: The UUID of the last successfully synced revision from the server.
    • last_sync_timestamp: The filesystem modification time (mtime) of the save at the time of the last sync.
  2. The "Smart Sync" Logic (Three-Point Comparison)
    Upon opening the app or a specific profile, the logic would compare the Local State, Server State, and Filesystem State:

Scenario Condition Result
In Sync Server ID == Last ID AND Local MTime == Last Time Skip (Nothing to do)
Auto-Push Server ID == Last ID AND Local MTime > Last Time Push (Local progress only)
Auto-Pull Server ID != Last ID AND Local MTime == Last Time Pull (Remote progress only)
Conflict Server ID != Last ID AND Local MTime > Last Time Prompt User (Divergent history)
  1. Automation Flow
    • On App Entry: Automatically scan the whitelisted games.
    • Batch Processing: Perform all safe "Auto-Push" and "Auto-Pull" operations without user intervention.
    • Conflict Handling: Only stop the process and prompt the user if a true conflict is detected, asking which version to prioritize.

Benefits

  • Data Integrity: Eliminates the risk of accidental overwrites.
  • QoL: Reduces the app usage to a single click (or zero clicks if fully automated on launch).
  • Efficiency: Only transfers data when a meaningful change is detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions