Compare commits

...

2 Commits

Author SHA1 Message Date
librelad
d442690324 Merge claude/2 2026-07-18 18:57:58 +01:00
librelad
b2db9984e6 fix(install): skip the premature step-11 WebUI update on a bootstrap install
A fresh install ran webuiLibrePortalUpdate twice back-to-back: once in
installLibrePortal step 11, then again in startScan at the end of preinstall.
The 30s time-debounce meant to collapse them is fragile (it never fired on a
recent install — >30s elapsed between the two), and debouncing is the wrong
lever anyway: startScan's pass runs AFTER scanConfigsForRandomPassword
finalises app passwords, so it — not the step-11 pass — is authoritative.

Defer the step-11 generation deterministically during a bootstrap install
(libreportal_bootstrap_install=true), leaving startScan's single pass to do the
work. Standalone reinstalls (no bootstrap flag) still generate in step 11. The
time-debounce stays as a general back-to-back backstop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 18:57:15 +01:00
2 changed files with 17 additions and 6 deletions

View File

@ -115,7 +115,16 @@ installLibrePortal()
echo "---- $menu_number. Generating all WebUI data files." echo "---- $menu_number. Generating all WebUI data files."
echo "" echo ""
webuiLibrePortalUpdate; # On a fresh (bootstrap) install startScan runs right after this and
# regenerates every data file — crucially AFTER scanConfigsForRandomPassword
# finalises app passwords, so that later pass is the authoritative one.
# Generating here as well would just be a premature duplicate, so defer to
# it. Standalone reinstalls (no bootstrap flag) still generate here.
if [[ "$libreportal_bootstrap_install" == "true" ]]; then
isNotice "Bootstrap install — deferring WebUI data generation."
else
webuiLibrePortalUpdate;
fi
if [[ "$libreportal_bootstrap_install" != "true" ]]; then if [[ "$libreportal_bootstrap_install" != "true" ]]; then
((menu_number++)) ((menu_number++))

View File

@ -4,11 +4,13 @@
# Coordinates all webui data updates including system info and app configurations # Coordinates all webui data updates including system info and app configurations
webuiLibrePortalUpdate() { webuiLibrePortalUpdate() {
# Debounce: during a fresh install this function gets called back-to-back # Debounce safety net: if this function gets called twice in quick
# by installLibrePortal (line 113) and then startScan (end of preinstall), # succession (e.g. two app installs in a row), skip the second run when the
# both within ~10 seconds. Skip if the last successful run is within the # last successful one is within the debounce window. The fresh-install
# debounce window. Callers that genuinely need a forced refresh can set # duplicate — installLibrePortal followed by startScan — is handled
# WEBUI_UPDATER_FORCE=1. # deterministically upstream (installLibrePortal defers to startScan during a
# bootstrap install), so this timer is only a backstop. Callers that
# genuinely need a forced refresh can set WEBUI_UPDATER_FORCE=1.
local stamp_file="/tmp/libreportal_webui_updater_last" local stamp_file="/tmp/libreportal_webui_updater_last"
local debounce_seconds="${WEBUI_UPDATER_DEBOUNCE:-30}" local debounce_seconds="${WEBUI_UPDATER_DEBOUNCE:-30}"
if [[ -z "$WEBUI_UPDATER_FORCE" && -f "$stamp_file" ]]; then if [[ -z "$WEBUI_UPDATER_FORCE" && -f "$stamp_file" ]]; then