Offline operation on the desktop
The desktop app (and the IntelliJ plugin it is built on) works offline with
the same declarations as the phone: the app’s offline.yaml (or its code twin) decides which
datasets come down, which screens work without a connection and how conflicts are settled. A UI
whose app shell says it has offline data (AppDto.offline) is taken offline the first time it is
opened with a connection; from then on it opens from this computer’s copy even with none.
What works
Section titled “What works”- The screens the manifest lists: listings (search, filters, sort and paging give the same rows
as online — the desktop runs the same conformance corpus as the server, the web and the phone),
record pages, create / edit / delete with the form’s own validations, lookups answered from
another dataset, and YAML pages over REST sources (
rest:datasets: the page’s rows, record and writes are answered from the copy). - Online, the server is always asked first. A covered screen is answered on this computer only when the connection is known to be down, or when the request fails as a connection failure or a timeout. Any other action on such a screen answers Needs a connection.
- The sync pushes the changes in the order they were made, each with its change id as
Idempotency-Key(a retried send is never applied twice), stops at a refused change or a conflict the user has to decide, then pulls every Down / Both dataset. It runs when the UI opens, when the connection comes back (the app keeps trying the server every 15 s while it is unreachable), when the window gains focus, on Sync now, and on its own after a failure (30 s, doubling to 10 min). - Conflicts follow the dataset’s policy;
ask(the default) opens the familiar compare-and-merge screen from the Sync tool window, and the decision is sent as a new change on the server’s current version. - Files in a dataset’s
fileFields: chosen offline, the file is kept on this computer and uploaded at the next sync with a fresh upload ticket, before the change that names it.
What the user sees
Section titled “What the user sees”- A status bar indicator: Synced, Syncing…, N pending, N need attention, or — offline — Offline — data from 2 h ago (Connect once to download the data before the first sync). Clicking it opens the Mateu Sync tool window.
- The Mateu Sync tool window: the changes waiting to be sent, the ones that need attention (the server’s message, Try again, Discard, Resolve for a conflict), the data kept on this computer per dataset with its last sync, and Sync now.
- Every text is in the six chrome languages (en, es, fr, de, pt, it), following the app’s language.
Where the data lives
Section titled “Where the data lives”One SQLite database per UI and per person, in the IDE’s configuration folder:
<config>/mateu-offline/<hub entry>/<person>.db. The person is a digest of the issuer, subject and
tenant of the signed-in account (read off the access token), so another person signing in on the
same computer never sees the first one’s data, and the file names carry no identity.
- Encryption at rest: every value stored — each record, its server copy, each pending change, each setting — is encrypted with AES-256-GCM under a random 32-byte key kept in the operating system’s credential store (macOS Keychain, KWallet / Secret Service, KeePass — the IDE’s password safe), never next to the file. Indexed values are stored as keyed hashes. Dataset names and record keys are not encrypted.
- Sign-out closes the database (it stays, locked, until the same person signs in again);
datasets declared
wipeOnSignOutare deleted. - Removing the UI from My UIs deletes its databases, files and keys, for every person.
- Logs carry ids and counts, never values.
Known gaps
Section titled “Known gaps”- With a non-JWT (opaque) access token the person cannot be told apart: everyone signing in to the same identity provider under one computer account shares one database.
wifiOnlydatasets are downloaded on any network (a desktop is treated as unmetered).- Only the screens the server lists work offline; any other action shows Needs a connection. The
desktop has no send queue:
@Action(offline = QUEUE)actions are not kept for later here. - Records changed offline are not yet marked Not synced inside the desktop’s listings (the rows carry the mark; the desktop renderer does not draw it yet).