What should a pharmacy app do when the internet goes down?

By Sayed Ali Reza Mosavi �

Imagine a pharmacy worker halfway through a sale when the connection drops. Can they finish the sale? If they reopen the app, will the sale still be there? If the connection returns while they are serving another customer, could the first sale be recorded twice?

These are the questions I want to answer while designing AsanKar’s pharmacy software. The first design target is a single device that can keep recording sales through an outage and tell the worker which records are still waiting to sync.

Give the worker a clear answer

If the device has safely saved the sale, the worker should see a confirmation that says so. If the save fails, the app should make that clear while the worker can still act on it. Once the connection returns, the app should show whether the pending sale has synced.

Test the interruption during a sale

The first test I’d run starts with the app open and a sale already in progress:

  1. Disconnect the device just before confirming the sale.
  2. Confirm the sale, close the app, then reopen it while still offline.
  3. Check that the sale is present and that its sync status is clear.
  4. Reconnect, interrupt the first sync attempt, then let it retry.
  5. Check that the sale appears once and the stock change was applied once.

I’d run that test on one device before introducing a second register. Two devices can sell the same item while disconnected, so a multi-register version also needs a clear way to resolve stock discrepancies.