Eleven pull requests merged across two repositories, one of them the previous log. Eight were the rest of the Kremio redesign that started the day before: the document screen, the list, the panes for foldables and tablets, Search, Me, About, error wording and the adaptive pass. They are all on the app’s main branch, and no new version of the app has been released. In infinary.io, a design for “Sign in with Infinary” was accepted, and its first step, Infinary accounts, was built, deployed and backfilled the same day.
- PRs merged, besides Field Notes
- 10
- of them in Kremio
- 8
- Kremio tests passing on main
- 605
- keys changed by the accounts backfill
- 0
Folding a phone, and the edit that didn’t survive
Until now Kremio was locked to portrait. The adaptive pass (kremio PR #42) removed the lock, so the app now has to keep whatever is on screen when the window changes shape. There turned out to be two separate reasons it didn’t.
The first was Android’s. When a device’s configuration changes, Android destroys and recreates the activity unless the app declares it handles that change itself, and React Native loses what was on screen with it. Expo’s template already declares rotation, size, layout, smallest width and dark mode. It doesn’t declare density. A foldable’s outer and inner screens have different densities, so folding or unfolding is a density change, and it recreated the activity. The PR adds density to that list through a config plugin. On the emulator, with an unsaved edit open, a density change threw the edit away on the build before, and kept it on the new one. The PR also listed the checks that passed: rotation, a density change, unfolding, unfolding then rotating, and multi-window mode, each with no restart.
The second was ours, and review found it. Earlier in the redesign we’d built Panes, which puts the list beside the document on wider windows. On a phone it rendered the visible pane straight inside its root; on medium and expanded widths it wrapped the two panes in two child views. React sees a different tree shape and remounts everything under it. So crossing from compact to medium, which is what a phone does when you turn it sideways or a foldable does when you open it, unmounted the document and its unsaved edit.
The fix keeps both panes in the same place in the tree for every window class, and on a phone hides the one that isn’t shown instead of leaving it out. A new test types a search into the list, widens and narrows the window, and checks the search is still there; it fails on the code before the fix. Sheets now allow landscape on iOS too, so turning the phone upright can’t happen underneath one.
A review fix that could have stopped the app starting
Me, the screen for your sites and settings (kremio PR #39), had a blocker of its own in review: someone with only one site had no way to sign in to it again once that sign-in expired. The fix flags, at start-up, any site whose sign-in tokens are gone. The next review found what that fix had added. On an iPhone, the keychain can refuse a read while the phone is locked, which is exactly when a background sync starts the app. A refused read isn’t “no tokens”, and treating it as one could have stopped the app starting.
Now only a definite “no tokens” flags a site, and a refused read changes nothing. The check runs without holding up start-up, and runs again when the app comes to the front. A failed start is no longer cached for as long as the app’s process lives.
Accounts, without changing a single key
In the platform behind our signups, the person who signs in has been a member keyed by their Google account’s subject id. Every membership, organization id, invite and idempotency key is built from that id. The plan for “Sign in with Infinary”, where the hub vouches for people on their own hosted ERPNext sites (infinary.io PR #362), needs a real account above that. It’s a design, and Nikolas accepted all 18 of its decisions on the 28th. One of them: a site proves who it is with a key it already holds, so there’s no client secret to store. Nothing of the sign-in itself is built yet.
Its first step was. Infinary accounts (infinary.io PR #363) add an acct_ id above each member without re-keying anything: each account records the member id it belongs to, which stays the Google subject. Members, memberships, organizations and idempotency keys are all unchanged, and code that only knows about members keeps working.
- One account per way in. The first sign-in finds or creates the account inside a transaction, so two sign-ins at once make one account.
- Email isn’t unique, on purpose. Two Google accounts with the same address both keep signing in. A shared address is recorded and logged by account ids, never by the address.
- Sign-in never depends on it. If the account store can’t be reached, sign-in still completes, just without an account id. Sessions from before accounts keep working.
- A backfill makes accounts for every existing member. It’s a dry run unless told to apply, it’s safe to run twice, and an undo removes backfilled accounts nobody has signed in to.
Control-plane tests went from 905 to 937, with 0 failing. The Firestore-emulator test wasn’t run, because the machine that built the change has Java 8 and the emulator needs 21, so before production we rehearsed on a scratch copy: export the production data, import it into a throwaway database, then dry run, apply, run again, undo and dry run once more. The second run found nothing to make, the undo removed everything, and the last dry run showed the full plan again. The rehearsal also turned up a detail for later: a backfilled account takes the email the member joined with, which can be out of date. It takes the current one at the next sign-in, so the identity provider should vouch only for an email seen at a sign-in.
The change was then deployed, and the backfill ran in production, after an export taken just before it. A second run made nothing, and the members check still passes. Nobody sees a difference yet: accounts are what the next steps build on.
Also
- The document at a glance (kremio PR #35). A header card with the ID, status and amount; the form’s tabs as a tab bar, with Activity last; one main action in the bar, and everything else, including Cancel and Delete behind a confirmation, under More. Duplicate leaves out the fields the desk’s own Duplicate leaves out, child rows included.
- List rows that read at a glance (kremio PR #36). Labelled dates, and empty or zero values left out, so a row never reads “0.00% · 0.00%” again. Sort asks for the direction once instead of listing every field twice.
- The list beside the document on foldables and tablets (kremio PR #37). Opening another document with unsaved edits asks first, and folding keeps the open document full width. The screenshots caught the document running under the status bar, then a fix for it that left a gap under the list’s header; tests run with no screen insets, so only the screenshots could.
- Search (kremio PR #38). A chip per document type found, results grouped by type, recent searches kept on the device, and search from the device’s own copy of documents when the site can’t be reached, with a banner that says so.
- Errors in plain words (kremio PR #40). Connection and sync errors are now worded by the app in the person’s language instead of passing an English message through, and the sync screen shows times in the site’s own date format.
- About and open-source licences (kremio PR #41). The list is generated from the dependency tree: 547 entries and 48 distinct licence texts, and the licence check now fails in CI when the list is stale. The Android and iOS native libraries aren’t listed yet; the store builds will need them.
- The nightly golden image passed with ERPNext 16.53.0 and Frappe 16.54.0, and its PR is open (infinary.io PR #360).