Working offline and syncing
How the phone keeps records without a signal, how and when it sends them, what it brings back, and what to do when a phone cannot sync for days. For workers, managers and the Support Engineer.A syndicate has no phones: everything is recorded in the console, online, so nothing here applies to it. See Holdings and sectors.
- Works offline
- Yes: recording, PINs, Today, Herd
- Syncs
- On its own while the app is open, and with Sync now
- Keeps
- Unsent records and the phone's key, in the phone's browser
- If stuck
- Save unsent records to a file; the manager uploads it
Setting up the phone, and signing in on it
The phone needs a connection once, to be set up. After that it works without one.
- In the console, on the Phones tab, the manager presses Add a phone, enters its name (such as House 2 phone) and presses Issue an enrolment code. The code is shown as text and as a QR code.
- On the phone, scan the QR code with the camera, or type the code (like ABCD-EFGH). Press Set up.
- Press Sync now to receive the holding's people and animals.
- A code works once, and only for 24 hours. If it fails, ask for a new one.
- Once set up, the phone asks how what it keeps is protected: by its screen lock or by people's PINs (see What the phone keeps is encrypted).
- Everyone on the phone signs in with a name and a PIN (4 to 8 digits, set by the manager). The phone needs no email address and no authenticator app. The email, the emailed sign-in link, Google and the authenticator code belong to the console, not to the phone.
- The app speaks your language: it changes when you sign in, and is remembered for you on that phone.
One phone for several holdings
A phone can be set up for up to 10 holdings: a manager who runs two sites, or a phone shared by two businesses. To each office it is a phone of its own, with its own key, people and records.
- To add one, press Add another holding to this phone on Who is recording? and enter that holding's code, or scan its QR code: the phone offers to add it. The holdings already there stay.
- With two or more, Who is recording? lists them under Holdings on this phone, each with how many of its records are not yet sent. Press one to open it; switching signs the person out.
- Records waiting on a holding that is not open are sent on their own, each as that holding's phone. Nothing of one holding is ever sent to, or shown on, another.
- A code for a holding the phone already has is not used: the phone opens that holding instead.
- Remove ... from this phone takes a holding off, once its unsent records are sent or saved to a file. Its manager then revokes the phone on the Phones tab.
How the phone keeps a record
Every record is saved on the phone first, in the browser's own storage on that phone. At the moment it is saved, the phone signs it with its own key, made when the phone was enrolled. That key never leaves the phone, so every record can be traced to the phone that made it. A signed record is never changed: not on the phone, not when it is sent, not in the office.
| State | What the phone shows | What it means |
|---|---|---|
| Waiting | Saved on this phone — not yet sent. and 3 records saved on this phone — not yet sent | Safe on this phone. The office cannot see it yet. |
| Sent | Everything is sent. | The office accepted it, or already had it. |
| Not accepted | The record under Not accepted, with the reason | The office refused it for good. It will never be sent again. |
- The phone checks each PIN itself, offline, against what the last sync brought.
- Herd shows the animals as of the last sync, with this phone's unsent records added. A row marked * includes records not yet sent.
- A store's balance on the phone takes off unsent feeding at once, fodder included, so nobody gives out more than the store holds.
- Today is worked out on the phone too: the daily sheets still to do and the schedule steps due (shown 3 days before they are due; red is overdue).
- The record's time is the phone's clock at the moment of saving, even if it is sent days later. A record dated more than 10 minutes ahead of the office's time, or more than 10 minutes before this phone's latest record, is refused (
CLOCK_AHEAD,CLOCK_BEHIND). If the phone's clock reads earlier than its last sync, the home screen warns before anything is recorded: "This phone's date and time are wrong: they are earlier than the farm'sthe holding's last sync." - A record stays the recorder's even if they leave the holding before it is sent: the office accepts it if they held the role when they made it.
A shared phone
- Press Switch person when you finish, so the next person records under their own name.
- Left untouched for 15 minutes, the phone signs the person out and goes back to Who is recording?. Unsent records stay.
- Five wrong PINs lock a person out on that phone for 5 minutes, then longer. A new PIN from the manager, once synced, lifts the lock.
When the phone syncs
The phone syncs on its own, while the app is open on the screen:
- when the app is opened, or comes back to the screen;
- when the phone gets its signal back;
- every 5 minutes while records wait to be sent;
- once an hour even with nothing to send, to fetch the holding's news (new people, PINs, schedules).
Sync now does it at once. Only one sync runs at a time: pressing it during an automatic sync waits for that one. The phone sends up to 100 records at a time and keeps going until nothing is left, so a phone offline for days empties its queue in one sync.
| The phone says | Means |
|---|---|
| Sent 12: 12 accepted, 0 not accepted. | All sent. Records already in the office count as accepted. |
| Sent 12: 10 accepted, 2 not accepted. | Two were refused. Read them under Not accepted. |
| Could not reach the server. Your records are safe on this phone and will be sent later. | No connection, or the office did not answer or was busy. Nothing was lost; nothing needs doing: the phone tries again by itself. |
| The server was reached, but it does not know this phone here, so it refused to take its records. They are safe on this phone. … | Shown at the top of the screen, with the phone's id (This phone is 1a2b3c4d.) and the server's code in small print; the sync line says Nothing was sent: the message at the top of the screen says why. Ask the manager for a new code and enter it under Set this phone up again (below). Nothing is lost. |
| The server was reached, but it refused this phone's request. … | Any other refusal of the phone itself. Its records are safe on it; show the manager the code in small print. |
| This phone's date and time are wrong: they are earlier than the farm'sthe holding's last sync. … | Shown on the home screen, before anything is recorded. Set the date and time in the phone's settings first, or what you record will be refused. |
| This phone has been revoked: it can send nothing more. … | The phone was revoked in the console. Save its unsent records to a file and give it to the manager (below). |
| This phone's clock is about 25 minutes off: set its date and time right, so records carry the right time. | Added after a sync when the clock is more than 10 minutes out. Set the time automatically from the network. |
A record the office refused
- Read the reason under Not accepted. The plain words say what to do; the office's own reason is in small print, for the manager or Support.
- If the fact really happened, record it again correctly.
- Press Understood.
A record refused for want of an approval, such as a sale, is asked for again; see Approvals and sales.
A phone the server no longer knows
If the server has lost this phone's enrolment, or the phone is set up for another holding, it refuses the phone's records and the phone says so. The records stay safe on the phone; nothing is dropped.
- The phone names itself at the top of the screen, for example This phone is 1a2b3c4d. Give the manager that id.
- The manager issues a new code in the console, on the Phones tab (Add a phone, Issue an enrolment code). Where the office knows the phone was the holding's, the manager also sees Phone not set up in Exceptions, with Issue a new code for this phone.
- On the phone, open Set this phone up again, enter the code and press Set up. If records wait, the phone offers to save them to a file first: do it, to be safe.
- The phone keeps its id and its unsent records, which go at the next sync. If it cannot keep them (the id is taken on another holding, or the code is another holding's), it saves them to a file first, for the manager to upload.
For security, the server never tells a phone it does not know whether that phone belongs to another holding: every such phone hears the same answer.
A record that got no answer (a dropped connection, a server fault) stays waiting and is sent again later exactly as it was saved. If the office had already recorded it, it answers that it has it, and the record counts once.
What a sync brings back
Each sync replaces the phone's copy of the holding with the office's. This copy is what the phone works from until the next sync.
| It brings | Used for |
|---|---|
| People with a PIN and a role that records on the phone | Who is recording? and the PIN check |
| The herd and the crop blocks, and every tag the farm has used | Herd, Blocks, choosing animals; refusing a tag already used |
| The holding's places and stores | The place codes the phone offers |
| The species and crops the farm keeps | Every stage, word and screen |
| Schedules, steps done, the week's daily sheets | The Today list |
| Items and each store's balance | Deliveries, feeding, counts; taking no more than the store holds |
| The manager's open exceptions, the last births, the months' status | The manager's Needs attention, the birth register, Count and Close the month |
| Settings and approvals, with the holding's key | Languages, and checking an approval offline |
Last sync on the home screen is the office's time of the last sync that worked.
Keeping the phone's records safe
Unsent records exist only on that phone until they are sent. The phone's key lives there too.
| If this happens | What is lost |
|---|---|
| The browser's data is cleared, or the browser or app is uninstalled | Every unsent record, and the phone's key. The phone opens on Set up this phone and must be enrolled again with a new code. |
| The phone is lost, stolen or broken | Every unsent record on it. |
| The phone is short of space, and the browser has not agreed to keep the app's data | The browser may clear it on its own. |
The home-screen warning
When the app starts, it asks the browser to keep its data. If the browser says no, the home screen shows: This phone's browser has not agreed to keep the app's data. Then:
- install the app on the home screen;
- never clear this browser's data;
- sync often.
A phone enrolled again after its data was cleared is a new phone. Revoke the old entry in Phones, or it will raise Phone not syncing.
What the phone keeps is encrypted
What a phone keeps (records not yet sent, the people and their PINs, photos and what the office sent it) is encrypted on it, so that someone who gets hold of the phone, or a copy of what it stores, cannot read it. It is opened once each time the app starts, for every holding on the phone, and closed again after 15 minutes in the background.
- Once the phone is set up, it asks how it should be opened. Press Use this phone's screen lock if you can: its fingerprint, face or screen lock opens the records, with a passkey. It is the best protection.
- Otherwise press Use people's PINs: the PIN of anyone who has signed in on the phone opens it, and the first person to sign in protects it. A phone that cannot use its screen lock for this is opened by PINs instead.
- Check this phone, on the app's first screen, says in seconds whether the phone can use its screen lock; where the browser cannot say, Try it makes a test passkey.
Here a phone is opened by its screen lock only: PINs are not offered. A phone set up before this was needed may record for 14 days more (phones.passkey_grace_days), then only sends what is waiting until it is protected. See Carers' phones, protected by their screen lockCleaners' phones, protected by their screen lock.
- Nobody can open it (a forgotten PIN, a screen lock reset): first, anyone else who has signed in on it opens it with their own PIN, and the manager sets a new PIN. Otherwise the manager presses Let this phone open its records under the phone on the Phones tab, saying why. For 24 hours the phone may then, online, press Ask the office and type the PIN of the person it belongs to (on a shared phone, one of those the manager named). The office checks it against its own copy and never keeps it; after five wrong PINs the manager must let the phone again. The Board is emailed when a phone is let and when it gets its key.
- The office keeps its own copy of a PIN only from when it is set in the console. A PIN set before the office kept one must be set again once, on the People tab, for the office to open a phone with it.
- The saved file of unsent records is encrypted too, and only the office opens it. A phone that has not reached the office since it was protected saves it in clear, and says so.
- A revoked phone, the next time it reaches the server, erases what it holds (the people and their PINs, what the office sent it, the records already sent, its key), keeping only the records it never sent.
- Start again on this phone deletes everything on it, the unsent records too: only when nothing else works and the manager agrees.
- The demo's phones are not encrypted: they hold only made-up people.
- Keep a screen lock on every phone all the same.
No signal for days: the saved file
When records are waiting, the home screen shows Save unsent records to a file. The file holds the waiting records exactly as the phone signed them, so it cannot be changed on the way. It can be carried to any computer.
On the phone (anyone signed in)
- Press Save unsent records to a file. The phone saves it to Downloads, or offers to share it, and says how many records it holds.
- Get the file to the manager: by cable, by message when a signal comes, or on a memory card.
- Keep recording as usual. The records stay on the phone until it syncs.
In the console (manager, Board or Support Engineer)
- Open Phones and press Upload a file from a phone. The form opens.
- Choose the file, then press Upload a phone's file.
- The console says, for example, 40 recorded, 0 already recorded, 0 not accepted, and lists the reason for any record not accepted.
- Each record is checked against the signature of the phone that made it. Whoever uploads it adds no authority.
- A record already in the office is counted once, however many times it is uploaded or synced. When the phone syncs later, those records are answered as already recorded.
- The upload counts as the phone's latest contact, up to the time of the last record in the file. Phone not syncing clears if that is recent enough.
- A revoked phone's file brings in the records it made before it was revoked. Records made after, or dated before the phone was even enrolled, are refused. Only the phone's clock says when a record was made, so the Board is shown Records recovered from a revoked phone: how many came in, the times the phone claims, and when it last synced and was revoked by the office's clock. The Board checks them and closes it with a note on what it found (at least 10 characters).
Alerts and limits
| What | Rule | Set by |
|---|---|---|
| Phone not syncing | A phone silent for longer than sync.unsynced_alert_hours (48 hours by default; 6 to 168) appears in the manager's Exceptions, checked every hour. It clears itself when the phone syncs, its file is uploaded, or it is revoked. | Board (Settings) |
| Approvals offline | A record that needs the Board's approval, such as a sale, is checked offline against the approvals the phone received. If the phone's last sync is older than offline.policy_max_age_days (7 days by default; 1 to 30), the screen says This phone's copy of the farm's rules is too old to approve a sale offline.This phone's copy of the holding's rules is too old to approve this offline. Sync first. Other records are not affected. | Board (Settings) |
| The phone's clock | Records carry the phone's time, so a wrong clock puts them on the wrong day, even in a closed month, where they are refused. A record more than 10 minutes ahead of the office's time, or more than 10 minutes before the phone's latest record, is refused outright, and the manager sees Phone clock wrong. The home screen warns when the clock reads earlier than the last sync. The phone warns after a sync when its clock is more than 10 minutes off; Phones in the console shows its clock is 12 min off from 2 minutes. | Nobody: set the phone's time from the network |
| A revoked phone | It can send nothing more, and says so. Its past records stay. The next time it reaches the server it erases what it holds, keeping only the records it never sent. Its saved file still brings in what it recorded before the revocation. | Manager, Board or Support (Revoke in Phones, with the reason) |
| One file | Up to 5,000 records. | Fixed |
The settings are described in the settings reference.
Common problems
| Problem | What to do |
|---|---|
| Records wait for days with a signal | Open the app and keep it on screen, or press Sync now. The phone syncs only while the app is open. |
| The phone says it has been revoked | Press Save unsent records to a file and give the file to the manager. Record new facts on another phone. |
| A new worker's name is missing | Press Sync now. If still missing, the manager checks the person has a PIN and a current role. |
| Locked out after wrong PINs | Wait, or ask the manager for a new PIN and sync. |
| A record under Not accepted says the month is closed | The fact belongs to a closed month. If it still matters, record it again now and tell the manager why it is late. |
| The phone was reset or its data cleared | Enrol it again with a new code. Its unsent records are gone: record the facts again from paper. |
| The phone says the server was reached but does not know this phone here | Ask the manager for a new code and enter it under Set this phone up again: the phone keeps its unsent records. See A phone the server no longer knows. |
| The phone will not reach a signal for a week | Save unsent records to a file and get it to the manager. |
| The enrolment code does not work | It works once and for 24 hours. Check each character, or scan the QR code; if it still fails, ask for a new code. |