Technology

Engine

How the Rust engine handles the app’s decisions and state

2026.12

Under review

Reviewing how the engine recomputes its state

After handling an action, the engine doesn’t know what changed, so it rereads and compares the state needed by the screen, lock screen, watch and widgets. We look at the cause and the alternatives.

2026.11

In use

Three criteria for automatic retry and recovery

We tried to resend and recover automatically every time something failed. But the more we resolved automatically, the more the app had to remember and reconcile.

In use

Removing the pass over every area after each input

Since November 5, the engine has gone through every area after each input, so one button press also runs 13 unrelated areas. We are removing this pass.

In use

Deciding rejections before changing state

Even when a save was canceled, the state in memory and the requests could already have changed. Instead of adding a way to undo them, we decide every rejection before changing state.

Removed

Handling user input and server responses separately

If a button press also has to process the server’s response, the device has to wait on the network. We separate what happens at the press from what happens afterwards.

In use

Rebuilding the engine from its data model

In October we worked from the old code and rebuilt its old structure as well. This time we define the data to store first, then rebuild the engine.

Reverted

Adopting Crux and reverting it

We wanted a request to reach the server only after the save was committed. We handed that job to Crux and took it back out the same day.

2026.10

Replaced

What went wrong when line count was the goal

We set out to make the app’s code far less than half its size. Working toward that number made it harder to tell the code to cut from the features to keep.

Partly changed

Moving screen decisions into the Rust engine

When a screen decides which buttons to show, the watch and lock screen have to make the same decision themselves. We move these decisions, and the text on screen, into the Rust engine.

Removed

Computing which screens to reread

We kept handwritten lists of the screens to reread when a record changed. We now compute them from the tables SQLite reads and writes.

2026.08

Partly changed

One engine answer for each screen command

Code meant to guard against mismatched versions stopped the app. We checked whether the versions could differ at all, and simplified how commands and answers are exchanged.

Figures come from the documents, change history and measurements of the time. Each article counts in its own way, so line counts cannot be compared with one another. Security, customer and business details are left out.