# Offline access and sync

> How Octa Pass keeps an encrypted local copy of your vault for offline use, syncs changes across devices in real time, and handles edit conflicts safely.

Source: https://octap.app/docs/features/offline-and-sync/
Status: in-progress
Project: Octa Pass

:::note[In progress]
The web vault preview syncs with the sync server. It pulls everything when you unlock, then listens on the WebSocket: another device's change, or a change to who's in a shared vault, arrives within moments. While the WebSocket is down it reconnects with backoff, and the tab falls back to syncing on focus and every 30 seconds while it's visible. Imports go up in batches of up to 1,000 items. If this device is signed out remotely (**Settings → Devices**), it learns at once and removes its copy of your vault. It keeps the encrypted records in this browser, so you can unlock and read your vault offline; saving needs a connection for now. A conflicting edit is kept as a conflict copy; merging edits field by field and the queue for offline changes come later.
:::

## Offline first

Every app keeps an **encrypted local copy** of your vaults (SQLite storing ciphertext blobs). You can unlock, search, view and edit items without a connection. Changes queue up and sync when you're back online.

Search uses an index that is encrypted at rest and decrypted in memory only while the vault is unlocked.

## How sync works

- Each vault has a revision number that increases with every change.
- Devices pull "everything changed since revision N" and push individual encrypted items.
- A WebSocket connection tells your other devices that a vault changed. It carries no data, only the fact that something changed.
- Deleted items go to the trash for 30 days. Deletion markers are kept for 90 days so offline devices catch up.

Protocol details: [sync API](https://octap.app/docs/developers/sync-api/).

## Conflicts

If two devices edit the same item while offline:

1. If the edits touch different fields, Octa Pass merges them.
2. If they touch the same field, the server's version wins, and your device's version is saved as a **conflict copy** in the same vault with a banner so you can choose.

Octa Pass never silently drops your data.

## Version history

Each item keeps its last 10 versions. Open an item and choose **Version history** to see them, and **Restore** to go back to one.

- Versions are encrypted with the item's own key, like the item. The server keeps them as ciphertext and can't read them. They count against your storage quota.
- Restoring is an ordinary edit, so the version it replaces joins the list and you can go back again.
- A version covers what the item says, not its files. Restoring keeps the item's current files and passkeys, keeps its password history growing, and never moves a counter-based code backwards.
- Reading the history needs a connection. Vaults on this device only keep no history yet.
- Moving an item to another vault starts its history again, because its encryption is tied to the vault.
