Skip to main content
Version: 0.2.0

Syncing Passes

In server mode, the DockWallet app synchronizes passes between the device and the server. Each connected device is registered individually and tracks its own sync state.


How Sync Works

The app uses an incremental sync strategy. On each sync, the server returns only passes that have been updated since the last sync. The last_sync timestamp is stored per device on the server.

A full sync (no since parameter) is triggered on the first sync after connecting. Subsequent syncs send the previous server_time value as the since parameter to fetch only changes.

After each successful sync, the server updates the device's last_sync timestamp automatically.


Triggering a Sync

Tap the sync button in the top bar of the passes screen. While syncing, a loading indicator replaces the button. The button is disabled during an active sync to prevent concurrent requests.

The sync button is only visible in server mode. In local mode, it is hidden.


Sync Summary

After each sync, the app processes the response and updates the local Room database. Added, updated, and unchanged passes are handled automatically. The sync summary is logged internally and can be observed via the ViewModel state.


Favorites

The favorite status of a pass is synced bidirectionally. Marking a pass as a favorite on one device will reflect on all other devices after their next sync. The server stores is_favorite per pass and returns it as part of the sync response.

Favorited passes are always displayed at the top of the pass list on all devices.


Managing Connected Devices

Open Settings → Connected Devices to see a list of all devices registered with the server. Each entry shows the device name and the last sync timestamp.

To remove a device, tap the delete icon next to it and confirm the dialog. Removing a device does not delete passes — it only removes the device from the server's sync registry. The device can be re-registered by logging in again.


Offline Behavior

The app works fully offline in local mode. In server mode, passes that were synced to the device remain accessible offline. Sync and pass uploads require a connection to the server and will fail gracefully with an error message if the server is unreachable.