Skip to main content

Working offline

Stores are hard places for a network. Back rooms, chillers, freezers and concrete stock rooms have dead spots, and store Wi-Fi drops in and out. The app is built so that staff never have to stop and wait for a signal: what they do is kept on the handset and sent when the connection allows, in the order it was done.

This is not a separate offline mode that someone switches on. It is how the app always works.

The rule: open it online, then keep working​

Work that has been opened while online carries on without a connection. When a colleague opens a stock count, a delivery or a Click and Collect order, the app keeps everything needed for it on the handset: the count's categories and items (up to 5,000 items), the delivery's lines, the order and its lines. From then on a dead spot does not matter.

What works without a connection, and what needs one. Without a connection: counting in a stock count opened earlier, stock corrections, receiving the lines of an opened delivery and Confirm delivery, picking, substituting and completing an opened Click & Collect order, saving or sending a store transfer request, and scanning or typing barcodes of items not yet looked up. With a connection: opening a count, delivery or order list the first time, searching items by name, approving deviations and submitting a count, creating a delivery note, choosing the store that sends a transfer, Stock events, Store Layout, and signing in again after 7 days offline.

  • Scan items the handset has not seen before. The app does not hold the whole product catalogue, so offline it cannot always tell what a barcode is. It records the barcode anyway, marked Unknown item — will resolve when online, looks it up when the signal returns, and only then sends the work.
  • Name search needs a connection, and the app says so. A barcode or item number can always be typed instead.
  • A count larger than 5,000 items is scan-only offline: the colleague scans each item rather than browsing the categories.
  • Reason codes for corrections and deliveries are kept on the handset. Settings → Refresh offline data loads them again after they have changed.

A practical rule for stores: open what you are going to work on before you walk into the dead spot.

The status strip​

A strip across the top of every screen says where the work stands. With nothing to report it is empty.

The status strip at the top of every screen. Offline · 3 pending in amber while work waits on the handset; Syncing… · 3 pending in amber when sending takes more than a few seconds; ✓ All synced in blue once the queue has emptied after a reconnect; 1 needs review and 1 failed · needs review in red when something could not be sent; Offline · reauthenticate when back online after 7 days without signing in. With nothing to report the strip is empty.

The strip saysIt meansWhat to do
Offline · 3 pendingno connection; three changes are kept on the handsetkeep working
Syncing… · 3 pendingsending has taken more than ten secondskeep working; it carries on in the background
✓ All syncedthe connection came back and everything waiting has arrivednothing
1 needs review or 1 failed · needs reviewa change could not be delivered as it standstap the strip and look at it in Pending sync
Offline · reauthenticate when back onlineseven days without a connectiongo online and sign in again

A second, orange bar, Storage nearly full — go online and sync to avoid losing offline work, appears when the handset's space for offline work runs low. The answer is a connection: once the work has been sent, the space is free again.

A dead spot, minute by minute​

A dead spot does not stop the work. In the Uppsala back room the handset has no signal from 10:01 to 10:07. The colleague counts 20 Baked Beans 400g at 10:02, 12 Tomato soup 300g at 10:04, and removes 3 damaged Yoghurt 500g at 10:06, while the strip reads Offline · 1, 2, then 3 pending. At 10:07 the signal returns, the strip shows Syncing… then ✓ All synced, and the services receive all three in the order they were made. Your systems get the events at 10:07, each carrying the time it actually happened.

What the app does to make this safe:

  • Everything goes through the handset first. Every change is written to the handset before it is sent, online or not. A crash, a flat battery or a restart loses nothing: the work is still there, and goes when the app is next open with a connection.
  • Oldest first, one at a time. Changes are sent one after another, oldest first, so a pick never overtakes the start of the picking it belongs to.
  • It tries again by itself. A timeout, a dropped connection or a busy service is retried, first within seconds, then at growing intervals for up to a day. When many handsets in one store come back online together, their retries are spread out rather than all sent at once.
  • Repeated taps become one change. Tapping + three times on the same line while offline sends one quantity, not three calls.

Sent twice, applied once​

The dangerous moment on a bad network is not a request that fails: it is one that succeeds while its reply is lost. The app then cannot know the change arrived, and sends it again.

A retried stock correction is applied once. The correction Remove 3 Yoghurt 500g leaves the handset and the stock goes from 12 to 9, but the reply is lost on the way back. The app sends the same correction again, marked as the same request, and the service recognises it: the stock stays at 9, not 6.

What keeps a repeat from counting twice depends on the kind of change:

  • A stock correction is a change, −3, so a second copy would double it. The app sends the same correction with the same identity and time on every attempt, and the services recognise the repeat and apply it once.
  • A recount of a location already on a stock count is sent with that location's line identity, its lineId, and states the location's total, 20 at Location 3. A repeat replaces the line with the same figure. Stock Count explains why the lineId is what makes this safe in retrying safely.
  • A received quantity or a delivery confirmation states a total for its delivery line, so a repeat sets the same value again and changes nothing.
  • A pick carries the version of the order it was made on. A repeat of a pick that already landed, or a pick on an order that has changed meanwhile, is refused rather than applied twice.

Pending sync​

Pending sync lists everything that is still on the handset. It opens from the status strip, or from Settings → Pending sync.

The Pending sync screen, opened from the status strip or from Settings. It says Offline since 10:01 and lists the waiting work by section: Pending resolution for a barcode not yet looked up, and Pending sync for a count of 20 Baked Beans 400g at Location 3 and a correction of Yoghurt 500g with reason Damaged goods. An entry the service refused appears under Conflict or Failed with Retry and Discard.

SectionWhat is in itWhat happens to it
Pending resolutionwork on a barcode scanned offline that the handset has not seen beforelooked up when the signal returns, then sent like the rest
Pending syncwork waiting to be sentsent by itself; nothing to do
Conflictthe service would not take it as it stands: the order changed meanwhile, or a scanned barcode matched no itemlook at it; Retry or Discard
Failedthe service rejected it, or it still could not be delivered after the app's own retriesRetry or Discard

Discard drops the change for good: it is never sent. Use it for work that should not go through, such as a pick on an order the customer has since cancelled.

Signing in while offline​

The app accepts its sign-in offline for 7 days after it was last online. Within that time it starts, and takes new work, with no connection at all. After that it still shows what it has, but takes no new work until the colleague is back online and has signed in again, so a handset that has been in a drawer for a month cannot write under an old sign-in.

What this means for your systems​

Offline work changes nothing in what your systems receive, only when. Three things follow:

  1. Events can arrive minutes or hours after the work. A count made at 10:02 in a back room reaches Stock Count when the handset is next online. The event carries the time of the work: order by that time, never by arrival.
  2. Events can arrive in bursts. Everything done in a dead spot arrives together, in the order it was done. A sudden run of events from one store is normal, not a fault.
  3. Do not treat late as wrong. A pick arriving after the order's pickup time was usually made in time on the shop floor.

Each service's events page says which field holds the time of the work and which field is safe to deduplicate on: Click and Collect, Stock Counts, Stock Corrections and Goods Received.