Alstre
Try it
11 · Mobile app

Automatic sync

Changes saved without a signal wait in a queue and are sent automatically when the phone gets a network. We explain what this covers, when sending starts, what happens on an error and how to check that everything got through.

What the queue covers

The queue covers changes to measurement items — adding an item, correcting a dimension, removing one. This applies both to field mode on the phone and to the item list on the measurement record. When there is no network, the save is put aside for later instead of reporting an error.

Photos are outside the queue
A photo is always sent directly to the server — the file would not fit in the browser's storage. Without a signal the upload will fail and the app will tell you so plainly. Dimensions keep saving, but the photo has to be added when the network returns.
A new item without a signal
An item created without a network does not yet have its own number from the database, so it gets a temporary one. You can fill it in as usual — all corrections remember what they belong to. The real number is assigned when sending and substituted in all queued saves.

When sending starts

The queue starts on its own at two moments:

  • When the connection returns — the browser signals that there is a network, and sending starts without you clicking anything.
  • When the app is opened — if the phone got a signal while the app was closed.
A signal is not always internet
The browser only knows that the phone is on a network — it does not know whether the server is responding. With a weak signal, sending may start and not finish. The changes then stay in the queue and will try again.

The order is preserved

Saves go one after another, in the same order in which they were made. The next one starts only when the previous one has finished.

This is not a technical detail. If a surveyor first added an item and then corrected its dimension, both changes have to arrive in that order — otherwise the correction would go to an item that does not exist yet.

What happens on an error

Every sending attempt ends in one of three ways:

Server accepted the save
The change disappears from the queue. The counter goes down by one.
No connection or the server had an outage
The change goes back to the queue and waits for the next opportunity. The counter does not go down.
Server rejected the save
For example when the measurement was deleted in the office in the meantime. Retrying will not help here, so the change is removed from the queue so that it does not block the rest. When the creation of an item is rejected, its later corrections are dropped along with it — they would have nothing to apply to.
After a long time without a signal
When a surveyor has worked for a long time without a network, after syncing it is worth opening the measurement in the office and counting the items. The queue copes with breaks in connectivity, but not with a situation where someone was changing the same measurement from the other side at the same time.

What the bar at the bottom of the screen says

Offline mode
The phone has no connection. Saves are put aside for later.
Syncing… (3)
There is a network, and three more changes are waiting in the queue. The number refreshes every few seconds.
No bar
Everything got through. This is the simplest check.

Where unsent changes wait

In the browser's storage on that particular phone. This has three consequences worth knowing about:

  • Closing the app or switching off the phone does not delete the queue.
  • The queue is not visible from another device — until it is sent, the office does not have these changes.
  • Clearing the site data in the browser deletes the queue along with its contents. Do not do this while the bar shows pending changes.

How to check that everything got through

  1. Check the bar
    It should disappear. As long as the counter is visible, something is still waiting.
  2. Open the measurement on another device
    On a computer in the office. If all the items are visible — the sync has finished.
  3. Check the photos separately
    Photos do not go through the queue, so a missing photo does not mean something is still being sent — it has to be uploaded again.

Every save leaves a trace in the event log — Audit log.