The native session already clears silent mode on touchpad input and re-reads it on every battery poll, so the TypeScript-side clearing duplicated that. The display-target trigger was also wrong: the communicator stays up in silent mode, so it cleared the flag on the next shell render.
tests/ios-glanceboard.test.cjs requires .test-build/app/g2/events.js, but events.ts was not in tests/tsconfig.json, so a clean build never produced it.
An ack is not a render: the lens can accept the create-prompt page and display
nothing, so a null check on the reply throws away the only thing that can say
what it did. The page size going out and the ack payload coming back are both
logged now.
Silent mode blanks the display and stops the firmware dispatching input while
BLE and GATT stay up, so the create-prompt page is written, accepted, and never
rendered. There is no touchpad event available to answer it with, and the flash
ends after four attempts on "prompt page not acked", which tells the wearer
nothing about what is wrong or what to do about it.
readBattery was already performing a sid-0x09 settings read whose ack carries
silentMode next to the battery, and the field was being discarded. readSettings
is factored out so one read serves both callers, and requireNotSilent runs it
before the prompt page is written. A positive report throws, and the existing
error path turns the message into what the wearer sees: that the glasses are in
silent mode, and that long-pressing both touchpads leaves it.
It refuses only on a positive report. An arm that does not answer, and firmware
whose ack omits the field, both fall through to the prompt exactly as before, so
older firmware is unaffected and a missing answer can never block a flash.
This replaces the phone-side confirmation fallback that was here before. An
unacked page is not by itself evidence that the prompt was never displayed, and
the on-lens step is what proves the glasses being flashed are the ones in front
of you, so overriding it on a timeout gave up more than it was worth.
Silent mode is entered and exited only by long-pressing both touchpads. While
it is on the firmware ignores all input and blanks the display, so from the
phone the glasses look connected and simply answer nothing. The app cannot turn
it off either: the communicator exposes onSilentMode and a listener set, and no
setter.
The status read "Connected (Silent mode enabled)", which names the state but
not the way out of it, and someone who triggered the gesture by accident has no
reason to know the gesture exists. It now names it.
The belief can also go stale. silentMode is set by the firmware's push event
and cleared only when the phase goes to disconnected, on the assumption that it
is re-reported on the way back up. Toggle silent mode on the glasses without
the link ever dropping and that assumption does not hold: a missed "off" leaves
the phone claiming silent mode for as long as the connection lasts. Observed
with the status reading silent while the glasses were granting framebuffer
leases and rendering frames, which cannot happen in a mode whose whole
behaviour is to blank the display and ignore input.
So the belief is dropped whenever the glasses do something that mode makes
impossible: input from them, since the firmware discards input while silent, or
a shell render that gets past the display-target check, since silent mode does
not leave a display target standing. The second matters because it self-heals
without the user touching anything.
Not unit-tested. Both halves are in dashboard-controller.ts, which imports 56
modules, so a test there would mostly exercise mocks, and the stale-clear is
state management across events rather than a pure function. The refactor that
would make it testable is moving the silent-mode belief into a small state
holder taking the firmware's push events plus the two kinds of contradicting
evidence; glasses-display-state.ts next door is already exactly that shape.
renderShell paints first and checks for a display target last, and the
stale-data repaint re-requests before that check. requestShellRender runs
`do { renderShell() } while (shellRenderQueued)`, and because a render is
already in progress the re-request just sets shellRenderQueued. So with no
display target the two feed each other: paint, report stale, re-queue, discard
the work, round again, with no yield and no backoff. SHELL_REFRESH_INTERVAL_MS
is 60 seconds, so the timer is not the driver.
Measured on a device with the glasses not presenting, from the app's own
frame-timings export: 40 of 40 recorded frames were render:shell
target=shell-overlay, every one discarded, mean 55 ms and median 53 ms apart,
so about 19 full renders a second all thrown away. Main thread state=Runnable
with utm=22599, and seven ANR records over three days, each "Input dispatching
timed out ... Waited 10001ms". Afterwards the same state produced 5 renders in
100 seconds, and the export showed a normal mixed workload again instead of
one loop crowding everything else out.
Hoisting the check above the paint fixes both halves at once: a frame with
nowhere to go costs nothing, and the stale-data re-request lives downstream of
the early return, so it can no longer feed the loop. The copy of the check that
used to sit after the paint is removed rather than left in place. Nothing
between the two points can change the result, and the compiler agrees: the
early return narrows this.phase, which made the "charging" comparison
unreachable (TS2367).
submitWindowFrame, the sibling path for in-process window frames, already
checks the display target before doing any work.
Not unit-tested. The change is in dashboard-controller.ts, which imports 56
modules, so a test there would mostly exercise mocks, and it is an ordering
defect rather than a predicate, so extracting a shouldPresent() helper would
pass both before and after. The shape that would work is pulling the render
gate and its stale-data retry into a small module taking the display target and
the stale flag and returning whether to paint and whether to re-request.
Glasses running an older Faceclaw firmware revision cannot be upgraded at all.
The flash asks for confirmation on the lens first, and that firmware never
shows the prompt, so the one path off it is closed. Measured on revision 13
(base 2.2.9.22).
showPrompt writes the EvenHub create-prompt page to the right arm and waits for
an ack. The lens accepts the write at the GATT layer and then answers nothing
and displays nothing: four attempts, four onWriteCharacteristic status=0
length=165, no reply. buildCreatePromptPage documents its geometry as
stock-firmware-safe "so this works before flashing", and that does not hold
there.
Three faults, each only visible once the previous one is fixed.
An unacked prompt page was fatal. Flashing is the only way off that firmware,
so failing here leaves the glasses permanently unupgradable. An unacked page
now falls back to the phone-side confirmation that the low-battery retry
already uses, on a screen that says what is being given up: the on-lens step is
what proves the glasses are the wearer's.
connectArm made a single attempt. The lens is routinely unavailable for a
moment just after a previous link to it closed, which is exactly the state a
retry is in, so the fallback failed instantly with "could not connect to the
right arm". FaceclawFirmwareFlasher.connectLensResilient already retries within
a window for this reason; connectArmResilient mirrors it and reports each
attempt.
That retry then tripped the lost-connection latch. Disconnecting between
attempts fires onConnectionStateChange, which set rightLost AND finished and
counted down the selection latch, so a successful second attempt still aborted
with "Lost connection to the glasses". The callback now ignores drops while the
arms are still being established.
Logging, because a failed flash used to leave almost nothing to read. emitLog
reached logcat, but emitState, emitProgress and emitComplete on the flasher,
and emitState and emitResult on the prompt communicator, went only to the
in-app listener, so the line carrying the reason existed only on the phone
screen. Seven `catch (Exception ignored)` blocks across the two classes now log
with the Throwable, matching the call sites elsewhere that already do.
tests/flash-prompt-fallback.test.cjs covers the decision at its seam through
the existing load-typescript loader. The first test fails against the current
view model and passes with this change; the second is a regression guard and
passes either way, so an unrelated failure cannot quietly skip the on-lens
confirmation.
Verified on hardware: both lenses flashed through this path after it had been a
dead end.
Open EvenHub once without finishing sign in and the phone side form comes back
on every app start, with no way to close it. Back exits the app rather than
closing the form.
Three things combine:
- EvenHubStoreLayer.paint() opened the credential editor on its first paint
when no credentials were stored. First paint includes the restore of a
still-open EvenHub at startup, so an unfinished sign in put the form back
every time. handleInput already opens it on a click, so the auto open only
removed the choice of when.
- LayerActions.startTextSettingsEdit declares a fifth onCancel parameter, but
the DashboardController wiring forwarded four and the method accepted four.
Nothing failed to compile, because a 4-parameter function is assignable to a
5-parameter function type. That callback resets openCredentialEditor's
phoneEditor guard, so with it dropped the guard latched at "credentials":
the screen timeout hid the panel without resetting the state behind it, and
the form could then be neither closed nor reopened. ios-preview-controller.ts
already forwards all five, so this was the G2 path only.
- The panel has no Cancel control, so the keyboard's Done key on the password
field is the only way to end the edit. On an untouched form that reached
submitCredentials, which called enterLogin("Email and password are
required."), which reopens the editor. A loop with no exit.
The auto open is removed; onCancel is forwarded, stored and fired from
endTextSettingEdit, with finishTextSettingEdit clearing it first so a completed
edit does not also report a cancel; and a wholly empty submission is treated as
a cancel. A half-filled form is a real mistake and still reopens with the
message.
tests/evenhub-signin.test.cjs covers the open and close contract through the
existing load-typescript.cjs loader. Two of its five tests fail against the
current store-layer.ts and pass with this change.
Runs gitleaks on pushes to main and on pull requests. The settings file
pull_config.sh produces holds API keys in plain text, and .gitignore covers the
default filename, but nothing catches a rename or a key in a test fixture.
.gitleaks.toml allowlists one path: the constant in app/apps/evenhub/even-api.ts
that matches the generic-api-key rule. Scoped by path rather than disabling the
rule, so everything else is still scanned.