PLANOMADHow the Rust engine handles the app’s decisions and state
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.
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.
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.
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 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.
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.
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.
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.
We kept handwritten lists of the screens to reread when a record changed. We now compute them from the tables SQLite reads and writes.
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.