Leonardo Borges Ramos

Offline POSBuilt in August 2026, in two phases

The register that keeps going when the internet drops.

How the Develop point of sale keeps selling with no network and syncs later, without losing a sale or charging it twice.

The Develop register for Windows, in the current version, ready for the first sale
Problem

In a store the internet drops. A register that needs the server stops, and the worst case is charging twice when it comes back.

What I did

The sale is written to disk first, in Rust, and joins a queue that uploads by itself when the network returns.

Result

The register sells offline and resending never duplicates: before closing again it checks whether the sale was already finalized.

90 sbetween queue uploads
1write function for online and offline sales
~240fewer lines in the POS routes
Role
Design and implementation, from the Rust command to the server route
When
August 2026, in two phases
Stack
Tauri · Rust · JavaScript · Node.js · Express · MySQL

The problem

In a store, the internet drops. A register that needs the server to close a sale stops with it, with a line of customers waiting. And the most expensive failure is not stopping: it is charging twice when the connection returns and the same sale is sent again.

The path of a sale

  1. The register closes the salenothing in this step depends on the network
  2. The sale is written to disk firstappend-only journal with fsync, through Rust commands
  3. It joins the outbound queuea badge shows the operator what has not been uploaded yet
  4. An agent sends every 90 secondswhen the network returns, in the order the sales happened
  5. The server writes it through the same function as an online saleone set of sales rules for both paths

Four decisions

Decided

1. Disk before network

BecauseIf the computer shuts down mid-sale, the sale is there when it comes back.

CostThe product catalog has to live on the register.

Read more

A sale only exists once it is written and confirmed on disk. If the computer shuts down halfway, it is there when it comes back. The product catalog also lives on the register, so it can sell without asking the server.

Decided

2. A resume that does not duplicate

BecauseWithout the check, the payment would go in twice on resume.

CostThe queue keeps more state: the official number and the items already written.

Read more

The queue keeps the official number the server gave the sale and the items already written. Before closing again, the register checks whether the sale was already finalized; without that, the payment would be recorded twice.

Decided

3. One write function

BecauseTwo sets of sales rules drift apart over time; one does not.

CostTouching the online sale write path, already in production.

Read more

Writing a sale moved out of the routes into a shared service: online sales and queued sales run through the same code. The POS routes file shrank by about 240 lines.

Decided

4. The server picks the path

BecauseTurning the server robot on or off changes every register without a new app version.

CostOne more question to the server before syncing.

Read more

The register asks the server which sync path to use. So turning the server-side robot on or off changes the behavior of every register without shipping a new app version.

The bug the test caught: every sale "duplicate"

  1. Codein Sequelize, an INSERT returns [insertId, affectedRows]
  2. Wrong readevery new sale answered "duplicate" and would never join the queue
  3. Before releasethe test failed and the read was fixed

What stayed: No sale was affected: the defect died in the test.

What is still missing

The offline register's product search returns at most 20 results per query; for stores with a large catalog, the next step is a local indexed search.

Quer conversar sobre este projeto?