InnerWeb
Skip to main content

FAQ: app work without signal and the offline queue

The shop floor, the basement, the paint shop and the storage yard share one trait: signal disappears exactly when someone has to record the result of a round or a report. We explain what the app does with a record when there is no network, and when the data actually reaches the system.

13 days
default retention time for idempotency records
Source: karta
4 states
visible to the user: waiting, synchronising, error, login
Source: karta

What happens to a record when there is no network

The web app stores failed requests that modify data, that is POST, PUT and PATCH, in the browser's IndexedDB queue. The user does not lose the filled-in form, and the request waits in the device memory until the network returns.

When the network returns, the queue replays the requests one by one. From the user's point of view the record was saved at the moment of the click, while from the system's point of view it appears only at the moment of synchronisation. This difference matters for real-time reports, so it is worth describing in the instructions for shift supervisors.

Does the queue handle photos and attachments

Yes. The offline queue also handles files and forms, so a report with a photo of a fault taken on the shop floor does not need the attachment added again after leaving the building.

Duplicates: can a record be created twice

This is the most common concern. When the network drops during sending, the app does not know whether the server received the request. Sending it again could create a second record. That is why every request that modifies data gets an idempotency key in its header, and the server recognises the repeat and does not create a duplicate.

The server remembers only results that ended in success, 2xx. After an error 4xx or 5xx the key is released, so a corrected version of the request can be sent again. Idempotency records are cleared after 13 days by default, which limits their growth and still covers a long period of work without a network.

  • An idempotency key in the header of every request that modifies data.
  • Storing the result only on success, 2xx.
  • Releasing the key after an error, 4xx or 5xx.
  • Clearing idempotency records after 13 days by default.

Sequence of retry delays following the Fibonacci sequence

Sequence of retry delays following the Fibonacci sequenceHorizontal bar chart: retry delays grow from 1 to 13 seconds following the Fibonacci sequence051015sTry 1Try 1: 1 s1Try 2Try 2: 2 s2Try 3Try 3: 3 s3Try 4Try 4: 5 s5Try 5Try 5: 8 s8Try 6Try 6: 13 s13
Source: Illustration of successive Fibonacci terms; the seconds scale is an example

What the user sees and how retries work

The queue status is visible to the user: waiting, synchronising, error or login required. This way the employee knows whether the entry arrived and does not repeat it out of fear that it disappeared.

The delays between successive retries grow according to the Fibonacci sequence. At the start the app tries often, so that data is sent quickly after a short interruption, and during a longer outage it slows down so as not to load the network or the server.

Login required after a long break

If the session has expired, the request is not lost: it enters the login required state and waits for the user to sign in again. After signing in, the queue sends the outstanding records.

Working without signal and radio devices

The offline queue applies to the app in the browser. The LoRa radio watch works differently: it does not need Wi-Fi, because its frames pass through a gateway, and the gateway translates them into HTTP requests to the system. When the watch hears no beacon, the frame is still sent, and the system substitutes the last known location.

In practice the plant therefore has two layers: the app with a queue for forms and rounds, and the radio for SOS and inactivity. Each of them hides the gap in coverage from the user, within its own scope.

What the queue does not do

The queue does not replace reading data: without a network the browser will not fetch new lists or photos from the server if they were not loaded earlier. It also does not resolve business conflicts, for example two people editing the same record, so the process should avoid this organisationally.

The queue should not be the only proof of work performed in a high-risk process. For permits and critical confirmations the rule is that only the status after synchronisation is audit evidence, while an entry in the queue is only protection against data loss.

Video

Frequently asked questions

Can a record entered without a network disappear?

The request goes into the IndexedDB queue in the browser and waits for the network to return. The condition is that the user does not clear the browser data or sign out at the end of the shift without synchronising.

What if the server responds with an error?

After an error 4xx or 5xx the idempotency key is released, and the request appears in the queue as an error. It can be corrected and sent again.

When does the data reach the system?

When the network returns, in subsequent retries with increasing delays. Until then the record is visible only on the author's device.

Records without gaps in coverage

We will show in a live demo how the offline queue behaves when the network drops and after it returns. Let us arrange a short demonstration.

Let's talk