Skip to main content

A Tablet Inspection Is Saved. Has the Office Received It?

Design offline inspection records that survive a closed app, a missing photograph, conflicting edits and a lost acknowledgement from the office.

R
Written by Reiko

At 09:10 a building inspector finishes a basement survey on a tablet. The form contains a meter reading, a photograph and a note about a damaged seal. She taps Save, sees a tick and moves to the next building. At noon the office calls. The meter reading is in the report, the photograph is missing and the seal is still marked intact. Everyone involved remembers seeing a successful save. Which part of the system made that promise?

Give the inspection a stable local identity and follow it across four events: a local commit, a scheduled transfer, acceptance by the office and receipt of that acknowledgement on the tablet. There may be hours between the first and third events. The last two can occur on opposite sides of a network failure. A useful interface gives the inspector a truthful description of the latest event the device can establish and keeps enough evidence to recover the work.

At the basement door: make Save mean something precise

Write the edited fields and the intent to synchronize them in one local database transaction, or use an equivalent recoverable mechanism. Suppose the app commits the reading and then crashes before putting it in the upload queue. A queue assembled only in memory will miss that inspection on the next launch. If the queue entry commits first, it can refer to a record that never existed. A durable outbox associated with the same transaction removes this particular gap.

The camera introduces a second storage boundary. A full-sized photograph may live in a file while the form contains its reference. Finalize the file, verify that the app can reopen it and then associate it with the record. Define what happens to a finalized file left behind by a crash before its reference commits. It can be collected later if it has no live owner. Deleting every unreferenced file immediately can race with an in-progress capture, so give temporary captures an identifiable lifecycle.

Now choose words for the tick. “Saved on this tablet” is a claim the app can support after the local commit. “Submitted to office” requires evidence from the receiving service. If a required photo is still missing, show that fact near the affected inspection and make the retained draft accessible. A technician searching a list of thirty sites should be able to identify the one unfinished upload without reopening thirty forms. A timestamp helps only if it is clearly attached to the local save or the office receipt.

Back on the street: assume a reply can go missing

Assign a durable operation identifier to a submission before the first attempt. If the office accepts it and the radio connection fails on the return journey, retry the same operation with the same identity. The receiving service needs a documented way to recognize that replay and return its original result. An implementation can bind the identifier to the record revision and reject accidental reuse for a different payload. A fresh random identifier for every retry defeats the protection.

Consider the 09:10 submission as revision seven. The tablet sends it, receives no acknowledgement, and the inspector changes the seal note at 09:18. This creates revision eight. When the receipt for seven finally arrives, it can mark seven as accepted. It cannot mark the current revision clean, because the office has not yet seen the new note. Keep the revision covered by every receipt and derive the visible status by comparing it with the revision currently displayed.

Connectivity is an opportunity to attempt a transfer. It supplies no evidence that the office has accepted a particular record. Captive portals, expired credentials and temporary server errors can all occur on a network the tablet considers connected. Distinguish an error that can be retried later from one that requires the inspector to sign in or fix a rejected field. Keep a useful pending state between attempts. Repeatedly asking the inspector to press Save encourages edits and submissions that are harder to reconcile.

Half a report reaches the office

Large files and structured records often travel by different routes. Suppose the photograph uploads but the final report submission fails. Keep the server’s durable attachment reference when one exists, and verify that it still belongs to the correct inspection and account before reusing it. Conversely, recording “form accepted” cannot imply “all attachments present” unless the server’s acceptance rule explicitly requires them. Write down what the office must have before the inspection appears complete to colleagues.

For a single required image, one design uploads the photograph first and submits a manifest containing its identifier and the form revision. The office verifies the attachment when accepting the manifest. For a long survey with dozens of photos, a service might accept a draft manifest early and expose a separate completion transition after every required object arrives. Either design can work. The dashboard, tablet and export job must agree on the meaning of the completion transition, or they will present different versions of the same site visit.

Check file identity as well as file presence. An inspector can replace a blurred picture with a sharp one while the old upload is in flight. Tie the upload to the attachment revision it started with. When the old transfer completes, its receipt should not overwrite the newer selection. A content digest can help verify that bytes match a declared object; it cannot determine which photograph the inspector intended to submit. That intent belongs to the inspection revision and its attachment references.

Two editors disagree about the damaged seal

While the tablet was offline, a coordinator corrected the building address. The returning inspector changed the seal status. If the tablet sends its entire older record as an unconditional replacement, the old address can come back. Have the write identify a base revision and define how the service detects intervening updates. A field-level merge may preserve independent edits to address and seal. It requires knowing which fields were intentionally edited, including the difference between clearing a value and never touching it.

Now suppose both people edited the seal. Choosing whichever device supplied the latest timestamp makes clock settings part of the inspection policy. For a field used to trigger a repair, present the two values with their authorship or other appropriate provenance and have an authorized person resolve the disagreement. Keep the local note available during the decision. A silent overwrite can erase the only explanation of why the inspector marked the seal damaged; an undifferentiated “Sync error” gives nobody a route to resolve it.

A supervisor may also withdraw an assignment while the inspector is in the basement. The server can legitimately decline new edits. Preserve the draft in accordance with the organization’s retention and access rules, and explain the permitted recovery route. Do not keep retrying a permanent permission failure every time connectivity changes. Where a shared tablet switches accounts, isolate each account’s queue and attachments. A pending inspection from the morning shift must never upload as the person who signs in after lunch.

The transfer has to survive an ordinary working day

Try reopening the app after the system has reclaimed its process, with the tablet still disconnected. The inspector should see the saved form and the pending operation without waiting for a network response. On Android, persistent scheduling facilities such as WorkManager can arrange eligible background work under constraints. The durable record and replay protocol still carry the correctness burden. A scheduler can delay work or run it again, and a foreground refresh can overlap a worker unless the application coordinates them.

Establish what local storage pressure means. If saving the image fails, a durable text draft can still be useful, provided the interface acknowledges the missing image and blocks a false completion. Once the office has accepted an attachment, retain or release its local copy according to the inspection policy. Avoid a general cache cleaner that treats the only offline copy of an unsent image as a disposable preview. A thumbnail can be regenerated only if the source it depends on still exists somewhere accessible.

Long queues need a way to make progress past an individual bad record. An image rejected for exceeding a documented limit should not hold up twenty independent inspections. At the same time, later edits to the same record may depend on its previous accepted revision. Schedule independent records separately and preserve the ordering constraints that matter within each inspection. Show the inspector the actionable item, such as a particular photograph that needs replacement, while ordinary transient retries proceed without demanding attention.

Reconstruct the morning from a controlled failure

Use a synthetic inspection and a test service that can accept a write and deliberately drop its response. Save the reading and photograph offline, restart the app, reconnect and trigger that failure. Edit the note before permitting a retry. Verify the number of office records, the accepted revision, the image identity and the local pending revision. A green icon is only one observation. The actual office data should contain one inspection with the intended attachment and the final resolved note.

Run a separate conflict test with two accounts authorized for the same dummy site. Change different fields from a shared base, then repeat with both users editing the same field. Record which cases merge automatically, which require a decision and what becomes visible to the other user after resolution. Finish by signing out with an upload pending and checking the next account’s list and worker behavior. These exercises reveal faults that a flight-mode toggle during an otherwise successful submission leaves untouched.

For support, log operation identifiers, revision numbers, attempt outcomes and transitions between local and office states. Meter readings, customer names and photographs need not appear in a synchronization trace. When the noon phone call comes in, support should be able to say “revision seven arrived with its photo; revision eight is waiting for a seal conflict to be resolved.” That answer gives the inspector a next action and lets the office distinguish an incomplete transfer from a disagreement about the building.

Did this answer your question?