Blue Butterfly is offline-first. Every change you make is written to local storage in your browser immediately, and synced to the cloud automatically in the background. This means:
- The app works without an internet connection
- Changes made offline are queued and uploaded when you reconnect
- You don’t have to think about saving — you just type, and it’s already saved locally
How sync works
- Local writes are immediate. When you save a drillhole, edit a cell, or run an import, the data is written to IndexedDB in your browser before anything else happens.
- A background sync runs every 30 seconds. It pushes any local changes to the cloud (Supabase) and pulls down any changes from collaborators or other devices.
- An additional sync runs immediately when connectivity is restored. As soon as the browser fires the
onlineevent, sync kicks off — you don’t have to wait for the next 30-second tick. - Large operations page in batches of 5,000 rows. This keeps each request inside Supabase API limits. Bulk imports may take several sync cycles to fully reconcile.
Sync status badges
Every drillhole card and drillhole header shows a sync status badge:
| Badge | Colour | Meaning |
|---|---|---|
| Synced | Green | All local data matches the server |
| Pending | Orange | Local changes are queued, not yet uploaded |
| Conflict | Red | A merge conflict was detected (rare; resolves automatically) |
A drillhole flips to Pending the moment you change anything. Once the next sync uploads the change, it flips back to Synced.
Conflict resolution
A conflict means the same record was modified locally and on the server (e.g., you edited a row offline and a collaborator edited the same row online during that time).
Local data always wins. When the sync engine detects a conflict, it keeps the local version, resets the record’s status to Pending, and re-uploads it on the next cycle. No manual resolution is needed — conflicts disappear on their own.
This means: if two people edit the same cell while offline, the last one to sync wins. In practice, conflicts are rare — most edits happen on different rows or different drillholes. If you’re worried, communicate with your team about who’s editing what.
Manual sync
The 30-second auto-sync is enough for almost every case. If you want a synchronisation right now — say, you’ve been logging offline for hours and want to confirm everything’s safely uploaded before walking away — click the Sync button in the drillhole page header. It runs the sync immediately and updates the status badge.
The Offline badge
When the browser detects no network connection, an Offline badge appears in the page header. The app keeps working. Every change is saved locally and queued for the next sync.
When connectivity returns, the badge disappears and a sync runs immediately. You don’t need to do anything.
Sign-out behaviour
Critical to understand. Signing out clears all local IndexedDB data for this browser. All cached drillholes, tables, and records are deleted from your local storage.
This is by design — when multiple people share a device, you don’t want one geologist’s data hanging around in the next geologist’s session.
The implication: always confirm everything shows Synced before signing out, especially on a shared device or after offline work. Unsynced Pending changes will be lost on sign-out.
If you’re on your own device and the network is unstable, a safer pattern is to leave the app open (and signed in) until connectivity returns and the badges go green.
What’s stored locally
Local IndexedDB holds:
- Every project you have access to (cached for offline)
- Drillholes, data tables, columns, records
- Sync metadata (status, last-modified timestamps)
Local storage is per-browser. Sign in on a new device and you’ll get a fresh download of everything from the cloud — but until that completes, the new device only knows what it’s seen so far.
Tips
- The 30-second tick is fine. You don’t need to manually sync constantly. The autosync handles it.
- Check the badge before leaving an unstable network. Field connectivity comes and goes — confirming Synced before you board a plane or descend underground keeps you safe.
- Don’t sign out for “fast switch” between accounts on the same browser. Use a different browser profile or window instead. Signing out is a destructive local operation.
- Conflicts almost never happen on the same row. Most teams divide work by hole, not by interval, so collaborators rarely touch the same record.