Addons

Online & Offline Sync

On this page

The internet in a branch office or at a hearing camp is not always there when you need it. With this addon the admin panel and the dealer portal keep working when the connection drops: pages already opened on the device still open, and the forms listed below are saved on the device. When the network is back, everything waiting is sent and changes made elsewhere are fetched, without anybody pressing a button.

Switching it on

Online & Offline Sync is a premium addon. It runs when your licence package carries it, or when its own addon key is activated on this site.

  1. Admin → Addons (in the System group of the sidebar): without the key the card shows Buy this addon and I have a key, and Enable is greyed out.
  2. A purchase arrives at the next licence check; Collect purchases now on Admin → License fetches it at once. A key from elsewhere goes into Addon key there. See The licence key and addon keys.
  3. Press Enable on Online & Offline Sync Addons.

Without the addon nothing is ever queued and the sync chip is not shown.

What staff see

The sync chip. The top bar gets a small round icon with a coloured dot. A number on its corner is how many items are waiting on this device. Click it for the Data sync menu: the current state (Online, Syncing…, Synced with the time, Offline or Sync failed), Sync now and Sync settings. In the dealer portal the chip shows the state in words, with a 🔄 button beside it for Sync now.

The connection notices. When the connection drops, No internet connection shows your offline message and a short checklist of what still works and what has to wait; it stays until somebody closes it. When the connection returns, Connection restored shows your back-online message and then 3 change(s) sent. or Everything is up to date., and closes by itself.

What can be saved offline

PanelForm
AdminAdd or edit a dealer
AdminAdd or edit a brand, a product or a free item
AdminEdit a serial number
AdminRegister or edit a warranty card
Dealer portalRegister or edit a warranty card

Saving one of these offline shows Saved on this device. It will sync automatically when you are back online. and the form is cleared for the next one. Every other form, invoices and payments among them, needs the connection, as do printing, e-mail, SMS and WhatsApp. A page never opened on this device cannot be shown offline.

The checklist inside the offline notice also names invoices and customers. In this version those forms need the connection, so tell your staff, and word your offline message to match.

A picture chosen in a form (a dealer's or a brand's logo) is not kept in an offline save; add it again once you are back online.

How the sync works

  • Every record carries its own ID, so a dealer created offline keeps the same identity on the server, and an item sent twice is applied once.
  • A connected device checks in every Sync every (seconds): it sends what is queued, then fetches what changed. A failed round waits longer before the next try, up to eight times the interval, so a struggling host is not hammered.
  • If somebody changed the same record on the server after it was edited offline, the newer server copy wins and the offline change is listed as a conflict on the Data Sync screen. A change that is not allowed (a dealer touching another dealer's record) is rejected and listed there too.

If the sign-in expired meanwhile, the round fails with Your session has expired. Please sign in again. Sign in: the waiting items are still on the device.

The addon's settings

Admin → Addons → Online & Offline Sync Addons → Settings:

SettingDefaultWhat it does
Keep pages on the device so they open without a connectiononInstalls the browser helper (sw.js) that keeps a copy of the pages you open.
Sync every (seconds)60How often a connected device checks in. Below 20 puts real load on a shared host; the browser never goes below 15.
Only sync while nobody is typingonSkips a round while someone types, while a field has the cursor, or while the tab is in the background.
Show a notice when the connection goes and comes backonOff leaves only the chip.
What the offline notice saysa ready textYour words in the offline notice.
What the back-online notice saysa ready textYour words in the back-online notice.
Dealers can work offline tooonOff keeps the dealer portal online-only.
Keep the sync log for (days)30The cron job removes older log rows.

The Data Sync screen

Admin → Data Sync (in the System group; the role needs Configure & run data synchronisation).

  • Counters: devices, operations today, conflicts and rejections.
  • Registered devices: each browser that has synced, its user, last pull, last push and items sent. × forgets a device; it registers again at its next sync.
  • Conflicts & rejections: what was not applied, and why. Recent operations: the last 25 items received.
  • Settings: Enable offline working and synchronisation is the server's master switch. Off, the server refuses every round (Synchronisation is switched off in the settings.) and items stay waiting on the devices. The other two boxes, Cache the panel so it opens without a connection and Sync every (seconds), are not what the browser reads in this version: use the addon's settings above.
  • Status with Sync now, and Housekeeping: Delete log entries older than a number of days, then Clean up.

While there are conflicts, the dashboard shows a Sync conflicts card that opens this screen.

Tips

  • Open the pages you will need while still online; a page is kept on the device once opened there.
  • Waiting items live in the browser itself. Do not clear its data or switch browsers while the chip shows a number.
  • Use the site over https://: browsers keep pages for offline use only on a secure address.
  • After a long offline spell, check Conflicts & rejections and enter again anything not applied.
  • The log clean-up runs with the cron job; see Scheduled jobs (cron).
Chat with Faruk
Faruk's Assistant Online — AI Powered