Skip to content

Maps on cluster: a map setting is saved only for the driver profile it was made for - #287

Open
robertnisipeanu wants to merge 5 commits into
mainfrom
waze-cluster-profile-writes
Open

robertnisipeanu wants to merge 5 commits into
mainfrom
waze-cluster-profile-writes

Conversation

@robertnisipeanu

Copy link
Copy Markdown
Owner

With Own settings for this driver in use, a Show on or HUD change could be saved into another driver's settings. The HUD map then came back a few seconds later. When the head unit's driver profile changes, the app takes two profile reads, 5 s apart, before it tells waze-on-cluster. Until then the page still shows the previous driver's settings and still accepted changes. A change made in that window, for example right after the app starts or right after a driver switch, was saved into the previous driver's (or the shared) settings. Moments later the new driver's stored settings replaced it on the cluster and HUD. On a test unit: the shared settings and Guest's own were both Cluster and HUD. After a switch from Guest to another driver, picking Cluster turned the HUD map off. 0.4 s later the new driver's settings were applied and the HUD map came back. The Cluster choice had been saved into Guest's settings.

What changes:

  • The app greys Show on and the HUD's settings (Keep HUD map over BMW's pop-ups, Size, Move, Centre) until the driver profile in use is settled. Settled means two reads agree, waze-on-cluster has that profile in effect, and no Own settings for this driver change is still waiting. The Own checkbox already worked this way.

  • Each write names the driver profile and the set it was made for: that driver's own settings or the shared ones ("profile", "own").

  • patchd saves a write only into that profile and set, and only while they are in effect. Otherwise nothing is saved, and the reply carries the settings in effect. The app puts those back on the cluster and HUD and tells patchd the profile again. This covers:

    • the window before the profile is confirmed;
    • a driver switch while the page is open;
    • the guest profile;
    • Own settings turned on or off mid-session;
    • the profile sync racing a page write.

    A write patchd accepts is held in memory for that profile at once. A switch before the delayed write to disk does not move it.

  • When patchd answers which profile is in effect, the page shows what is stored for that driver. It moves the cluster and HUD to those settings if they show others. An answer that is older than a change made on the page since is not used.

  • What is stored stays as it is. Nothing is migrated: a value an earlier version saved for the wrong driver shows for that driver, who can correct it. profiles.json and map.state.conf keep their format. A write without "profile" (an earlier app) goes into the settings in effect, as before.

  • Version requirement: the app requires the next waze-on-cluster.

AI: Claude Code, Claude Opus 5.5

Tested:

  • waze-on-cluster: make test-node, all suites passed, including the new patchd_profile_write_test.js. That test covers:

    • a write before any profile is told;
    • a write for driver A while B is in effect, refused with A's, B's and the shared settings unchanged;
    • a write for the other set;
    • both orders of a switch and a write on one connection;
    • a switch before the delayed write;
    • the guest profile;
    • Own ticked and unticked mid-session;
    • an earlier app's write without "profile";
    • an earlier release's files kept as they are.

    It passes 4 of 18 checks against main's patchd. The 4 that pass check things main already does right: the guest profile's settings, an earlier app's write, and an earlier release's files.

  • The app: tools/test_profiles.js 24/24, tools/test_page.js all passed, tools/test_control.js 53/53, tools/test_i18n.js passed. The new checks fail on main's app code:

    • the page greyed until the profile is settled, and a pick there sends and saves nothing;
    • each write names the profile and set;
    • a refused write puts the stored settings back;
    • the page shows the stored settings when it opens;
    • the settings never count as settled during a switch;
    • a late profile answer leaves a newer change in place.
  • A test unit: iDrive 7, with the published Store.

    • Before (Maps on cluster 0.6.16 and 0.14.14): a pick in the window after a driver switch was saved into the previous driver's settings, and the HUD map came back 0.4 s later.
    • After (this branch):
      • Updating with a profiles.json and map.state.conf in place kept both files byte for byte.
      • Show on and the HUD rows were greyed in the window; picks there saved nothing.
      • Each driver's page showed that driver's stored settings, including the value the bug had saved into Guest's.
      • patchd refused a write sent for Guest while the other driver was in effect, and changed nothing.
    • Rollback: going back to 0.6.16 and 0.14.14 left both files as they were and added nothing. That release read them without warnings and its page worked.
    • The test unit ran this branch before its last commit (3ffa570: the settings stay greyed through the redraw during a switch, and a late profile answer no longer undoes a newer change). That commit is covered by the suites above.
  • Not tested: a real car, and a live CarPlay stream on the HUD (the test unit's HUD map had no frames; the HUD map's on and off states were read from the map service's log).

Human review: no, not before opening.

Screenshots: the page on a test unit, a moment after a driver switch, before the app has confirmed the new driver.

Before: Show on takes a pick After: Show on greyed
before after

After the update, Guest's page shows what is stored for Guest, including the Cluster an earlier version had saved there from the other driver's page:

after: Guest's stored settings

🤖 Generated with Claude Code

robertnisipeanu and others added 5 commits November 25, 2026 07:08
…made for

The app's Show on and HUD settings are greyed until the driver profile in
use is settled (two agreeing reads, told to patchd, no Own tick waiting),
and each write names the profile and set (own or shared) the page showed.
patchd saves a write only while that profile and set are in effect and
otherwise refuses it with the settings in effect, which the app puts back
on the render. Each answer of patchd's about the profile moves the page's
render to the settings stored for it when it shows others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…swer keeps a newer page write

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ixed time

The checks that take a snapshot after a profile switch or an Own tick, or
check map.state.conf after one, waited the save's delay plus 150 ms. A save
syncs the disk twice and can take longer on a busy machine (0.6 s on CI),
so they read the files before the write. They now wait until the write
they expect has landed, as the other checks do. The refused write in the
switch check sets a value none of the three sets holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant