Repository navigation
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
Open
robertnisipeanu wants to merge 5 commits into
robertnisipeanu wants to merge 5 commits into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.jsonandmap.state.confkeep 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 newpatchd_profile_write_test.js. That test covers:"profile";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.js24/24,tools/test_page.jsall passed,tools/test_control.js53/53,tools/test_i18n.jspassed. The new checks fail on main's app code:A test unit: iDrive 7, with the published Store.
profiles.jsonandmap.state.confin place kept both files byte for byte.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.
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:
🤖 Generated with Claude Code