Skip to content
Back to blog

Engineering

PWA offline scope matrix: what each task does without a network

Reading time
7 min read
Published
Last updated
PWA offline scope matrix: what each task does without a network

List every task your users perform, then decide for each one whether it works offline, how fresh its data must be, what the screen says and how you test it.

Before anyone writes offline code for a progressive web app (PWA), fill in one table with a row for each task your users perform. For each task, decide what happens in four states: online, on a weak or unstable connection, offline and when the device reconnects. Then record where its data comes from, how old that data may be, what the user sees and how you will test it. Below are the five modes a task can run in and the template. After them comes the matrix we wrote for ClinicTek, the clinic management system BarmajTek builds, runs and supports.

A PWA is a website that people can install and use like an app. Its service worker is the script the browser runs between the app and the network, defined in the W3C Service Workers specification. Your matrix tells whoever writes the service worker which requests it may answer from the device.

The five offline modes

When the network is gone, every task runs in exactly one of these modes.

Article data table: The five offline modes (1)
ModeWhat the user can doTypical tasks
Online onlySees the control disabled, with one explanationPayments, refunds, permission changes, reserving a booking slot
Cached viewReads a saved copy that shows its ageSchedule, queue, dashboard
Local draftTypes and saves on the device; nothing is sent yetVisit note, inspection form
Queued commandSubmits; the app sends it when the network returns, and the server accepts or rejects itUpdates to a saved draft
Fully localWorks with no server at allCalculators, personal checklists with no shared data

A queued command must be idempotent: when the same command reaches the server twice, the server applies it once and returns the first result. Without that guarantee, every retry risks a second record.

The matrix template

Each row below is one column of your matrix, laid out vertically so it reads on a phone. Fill in one copy per task and copy the answers into that task's row. The right-hand column shows a filled copy for booking an appointment.

Article data table: The matrix template (2)
FieldWhat to writeExample: book an appointment
TaskThe action in the user's wordsBook an appointment
OnlineNormal behaviourPick a slot; the server reserves it
Weak or unstable networkWhat changes when requests are slow or keep droppingShow "Checking availability" and keep the slot unbooked until the server answers
Offline modeOne of the five modesOnline only
Data source and freshness limitWhere the data comes from and the oldest copy you acceptAvailability from the server only; no cached copy
Stored on the deviceWhich fields, for how long, and what clears themThe details the user typed, cleared on logout
What the user seesThe message in each state"Booking needs a connection. Your details are saved."
Conflict ruleWhat wins when the device and the server both changedThe server decides; the slot may be gone
Retry ruleWhich failures retry, and howNetwork errors retry with backoff and jitter; "slot taken" never retries
Acceptance testThe test that proves this rowLose the network mid-booking, reconnect, and confirm there is no booking and no lost input

Backoff means waiting longer after each failed attempt. Add jitter, a small random offset, so that many devices do not retry at the same moment.

A filled example: the offline design we wrote for ClinicTek

ClinicTek is online-first, so the app expects a connection and offline support covers only the tasks in the table below. We wrote its offline design so that recent work stays on the device until it syncs. Every change replayed after reconnection passes the same server checks as a live one. The rows below come from that design document as of 4 November 2026.

Article data table: A filled example: the offline design we wrote for ClinicTek (3)
TaskOffline modeRule we set
Schedule, queue and My Day screensCached viewSnapshot replaced after reconnection; staff snapshots kept for 7 days at most; cached data shows its age
Patient portalCached viewPortal snapshot kept for 24 hours; queue snapshot for 15 minutes
Update a visit draftQueued commandThe server checks the exact record version; on a conflict both copies are kept; a draft stays until it syncs, the user discards it or it is 30 days old
Approve or amend a visitOnline onlyNever queued
Create, move or hold an appointment slotOnline onlyCapacity is never reserved offline
Invoice, payment, refundOnline onlyFinancial data is never stored on the device
Consent signatureOnline onlyCaptured only while connected
File or dictation uploadOnline onlyUploaded only while connected
Settings, permissions, integrationsOnline onlyChanged only while connected

Three decisions shaped the rest. First, the sync interface accepts named operations and never raw URLs, so the server knows exactly what each queued item means. Second, a task joins the offline list only when it has all of these:

  • input validation
  • permission checks
  • idempotent replay
  • a version check
  • audit logging
  • a translated conflict screen
  • allow and deny tests for every role that can use it

Third, a kill switch, a setting the team can turn on at any time, stops new queueing and keeps pending drafts visible and exportable.

Build your matrix in eight steps

  1. List the tasks on your three most important screens, in the words your users use.
  2. Mark every task that moves money, creates a legal or tax document, changes permissions, changes stock or reserves capacity. Those run online only.
  3. Give every remaining task one of the five modes.
  4. Set a freshness limit for each cached view and show the data's age on screen.
  5. Decide what is stored on the device, for how long, and which events clear it. Those events are logout, a switch of account or organisation, a rejected session or an incompatible app update.
  6. Write the conflict rule for each queued command. When a person must choose, keep both versions and show them side by side.
  7. Write the retry rule. Network errors, rate limits (HTTP 429) and server errors (HTTP 5xx) retry with backoff and jitter. Validation and permission rejections stop and ask the user to review. The server re-checks permissions when it replays each command, because a user allowed to act yesterday may have lost that right today.
  8. Write one acceptance test per row and run it on real phones.

Write the message for each state

Users need one place that tells them what the app is doing. For ClinicTek's staff screens we wrote a single status line, with this wording for each state:

Article data table: Write the message for each state (4)
StateWhat the status line saysHow long it stays
OfflineNo internet connection. Safe drafts stay on this device.Until the connection returns
SyncingReconnecting and syncing…While queued work is sent
Up to dateUp to dateA moment, then it hides
Needs attentionSome saved work needs your review.Until the user reviews the affected item

In the design, controls for online-only tasks stay visible and disabled, with one explanation. If the clinic record changed while the device was offline, the conflict sheet we designed shows Your saved draft and Current clinic version side by side. Its two buttons are Keep my draft and Use clinic version, and we specified that the app keeps both copies until the user picks one.

Test on real phones

Throttling the network in a desktop browser covers the basics. Real phones add the cases your matrix must survive:

  • the operating system clearing stored data when storage runs low
  • the app closed, or the phone restarted, with work still queued
  • a session that expires while the phone is offline
  • a connection that drops and returns again and again
  • an app update that arrives while a draft is waiting
  • background limits on the service worker

MDN Web Docs notes that browsers limit how many times, and for how long, a background sync can run. It adds that Chrome is likely to stop a service worker after 30 seconds idle. Background sync therefore cannot be your only recovery path. Also sync when the app starts, when the browser reports it is back online and when the app returns to the foreground. We wrote all three triggers into ClinicTek's design.

For storage and caching choices, read our guide to offline-first PWA patterns. For merge rules when both sides changed, read our guide to resolving offline sync conflicts.

Have us review your matrix

Send us your three screens and your draft matrix through the project brief, or message us with the WhatsApp button on this page. In a free first chat we go through the rows with you and mark the tasks that must stay online. Then a short paid study at a fixed fee, credited to the project, puts the scope, a cost estimate and a timeline in writing. It takes about five working days. If you are planning a web platform, see custom web platform and SaaS development, and read how we build and run ClinicTek.

Sources

#Architecture #Offline-first #PWA

Read our editorial policy

Continue reading

Related articles

  1. Cover: Define the export before you need to leave
  2. Cover: Designing Multi-Tenant SaaS Architecture in Laravel
  3. Cover: Flutter + Laravel: One Backend, Every Screen

Building a custom system for your business?

After “PWA offline scope matrix: what each task does without a network”: tell us scope, users, and integrations — we reply with a practical plan after reviewing your request.