Skip to content

Add manual modem mode choices and passive trial history - #52

Draft
pjeweb wants to merge 3 commits into
osb/pr/frontend-bundle-boundariesfrom
osb/pr/lte-5g-first-slice
Draft

pjeweb wants to merge 3 commits into
osb/pr/frontend-bundle-boundariesfrom
osb/pr/lte-5g-first-slice

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 13, 2026 •

Copy link
Copy Markdown

Why

On some networks a modem uploads more cleanly on LTE than on 5G, and a streamer may want to keep that modem on LTE. Today there's no simple choice for that, and nothing remembers it for the modem. Before the box ever tries changing modes by itself, it should also first just record when it would have tried. There is no automatic mode switching of any kind in this PR.

What

  • Each modem gets a mode choice, Automatic or LTE only, next to the existing 5G preferences. It's refused while streaming, and the confirmation names the modem and says the connection drops for some seconds.
  • The choice is remembered for the modem itself, not the USB port. If the modem's live mode no longer matches, the box says so and offers "Use … again"; it never re-applies a choice on its own.
  • A save that fails after the radio already changed says so plainly ("The modem switched to …, but this device could not save the choice").
  • A passive "would have tried" history, bounded in size and age. Today it always says "would not try", because the inputs it needs don't exist yet.

How: the choice goes through the existing ModemManager preference path (the system service that controls modems), with its checks, a journal of the previous state and a readback, and only one mode write runs at a time. The saved choice is keyed by a keyed hash of the modem's equipment identifier under a device-local key, so the IMEI is never stored. docs/MODE-CHOICE.md has the rules and a checklist for the first run on a device. All new strings are in ten languages.

Sits on #95; land that first.

Screenshots

Before and after at phone and desktop widths

Mock data at the PR base and an earlier head. These images illustrate the mode controls; they do not verify reconnection time.

Before After
Before: Modem mode choices and saved-choice mismatch (390 px) After: Modem mode choices and saved-choice mismatch (390 px)
Before: Modem mode choices and saved-choice mismatch (1280 px) After: Modem mode choices and saved-choice mismatch (1280 px)

Your call

  • Translations beyond English and Spanish need a native read.
  • After a modem-settings save, the detail can briefly show a mismatch until the next status poll updates the live mode. Is that acceptable?
  • A key file that fails its checks blocks saving until someone repairs it and restarts the backend. Should there be a reset path in the UI?

How to verify

With mock data, open a modem's settings, pick LTE only and confirm: the dialog warns about the drop, and the choice shows as saved. Change the mock's live mode and the dialog shows the mismatch with "Use … again". apps/backend/src/tests/mode-choice*.test.ts and ModemConfigDialog.radioSelectors.test.ts cover the rules.

Testing and limits
  • The focused backend tests, the modem dialog tests, rpc and translation tests and the type checks pass.
  • History expires on cached and cold reads, and an interrupted first key write can be retried.
  • On a modem that only offers 4G and 5G, "5G off" would duplicate LTE only, so it isn't offered there.
  • The largest production chunk grows by about 15 kB (about 5 kB gzip) on top of Keep production UI builds below the existing chunk limit #95; the size checks pass.
  • Not tried on hardware: reconnection time after a mode change is unmeasured.

Risks

A mode change drops that modem's connection for a while, which is why it's refused while streaming and always confirmed.


Checklist

  • Docs updated if behavior or structure changed (Rule A: AGENTS.md within budget, README, docs/, versions.yaml)
  • User docs (Rule G): no user-visible change, OR ceralive-docs PR updates English and Spanish, plus ceralive-website PR if a landing claim changed
  • Started from updated main; branch rebased on latest canonical branch (Rule B)
  • Rule D local-scratch reference check passes for tracked files
  • Tests pass; QA evidence attached or linked

@pjeweb
pjeweb force-pushed the osb/pr/lte-5g-first-slice branch from d8c7ebc to 0c703ce Compare November 14, 2026 12:46
@pjeweb
pjeweb changed the base branch from osb/integration to osb/pr/frontend-bundle-boundaries November 14, 2026 12:46
@pjeweb pjeweb added stacked Depends on another pull request; review and integrate parents first. upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal. labels Nov 16, 2026
@pjeweb pjeweb added the train: image-5 In the integration that ships in image 5; the label moves on when images advance. label Nov 21, 2026
@pjeweb pjeweb added train: image-6 In the integration that ships in image 6; the label moves on when images advance. and removed train: image-5 In the integration that ships in image 5; the label moves on when images advance. labels Nov 24, 2026
The test wrote 300 evaluator records, each a durable write with a file
and a directory fsync. On a SATA SSD those ~600 fsyncs took 5 to 12 s,
alone or in the full suite, at any head, so the test timed out on disk
speed rather than on the rule it checks. Overflowing the per-source cap
by ten records proves the same rule, and the test now also checks that
the oldest evaluator records were the ones evicted. The remaining ~126
fsyncs still took 3.6 s there while other writers shared the disk, so
this test gets its own 20 s timeout.
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@pjeweb pjeweb added the train: next Reviewed and ready for the train after the current image. label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stacked Depends on another pull request; review and integrate parents first. train: image-6 In the integration that ships in image 6; the label moves on when images advance. train: next Reviewed and ready for the train after the current image. upstream: waits for intent Needs an issue or maintainer agreement before an upstream proposal.

Development

Successfully merging this pull request may close these issues.

1 participant