Skip to content

webroot: serialize VDLU config writes - #24

Draft
ash-iir wants to merge 1 commit into
mainfrom
fix-vdlu-config-race
Draft

ash-iir wants to merge 1 commit into
mainfrom
fix-vdlu-config-race

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 19, 2026

Copy link
Copy Markdown
Owner

WebUI #3. writeConfig (vendored vdlu.js) builds the whole config file from cfgCache, and cfgCache was only updated after the exec resolved. Two quick switch taps (auto_on_webui_open=1, then auto_on_reboot=1) produced a file with only one of the keys, so a toggle the UI showed as on was off on disk.

  • writeConfig now queues each write on one promise chain; each write builds its body from the cfgCache the previous write left. A failed write does not block later ones, and the caller still gets its own promise (so the existing toast/revert handlers behave the same).

vdlu.js is vendored; the same change may be wanted where it comes from.

Testing

  • node --check on vdlu.js.
  • Node harness that evals the real writeConfig with a stub ex (first write 300 ms, second 10 ms): with this change the file ends as auto_on_webui_open=1 + auto_on_reboot=1; on main it ends with one key only.
  • Not run in the WebUI mock harness (the VDLU panel is not part of shoot.py's screens).
  • Not tested on a rooted device.

writeConfig builds the whole config file from cfgCache, which was only
updated after the write finished, so a second write started before the
first resolved dropped the first one's key on disk while the UI still
showed it on. Chain the writes so each starts from the result of the
previous one.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.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