Follow-up to #120. The settings.json backup guard checked tail -c1 == "}", but the file ends with }\n — so the last byte is a newline and the guard always skipped ("not }-terminated"), producing no backup. Verified live: the service logged the skip and no .bak was created.
Fix: strip trailing whitespace before the terminator check (tail -c 64 | tr -d '[:space:]' | tail -c1), so a valid newline-terminated file is backed up while a genuinely truncated/mid-write file is still rejected. Logic tested.
Docs/script only, no runtime/service change beyond the script contents. Applying just updates the script (no container bounce); I'll run the backup service once after to seed the first .bak.
Follow-up to #120. The settings.json backup guard checked `tail -c1 == "}"`, but the file ends with `}\n` — so the last byte is a newline and the guard always skipped ("not }-terminated"), producing **no backup**. Verified live: the service logged the skip and no `.bak` was created.
Fix: strip trailing whitespace before the terminator check (`tail -c 64 | tr -d '[:space:]' | tail -c1`), so a valid newline-terminated file is backed up while a genuinely truncated/mid-write file is still rejected. Logic tested.
Docs/script only, no runtime/service change beyond the script contents. Applying just updates the script (no container bounce); I'll run the backup service once after to seed the first `.bak`.
The zwave-js settings backup guard in #120 checked `tail -c1 == "}"`, but
settings.json ends with "}\n" — so the last byte is a newline and the guard
always skipped ("not }-terminated"), producing no backup. Strip trailing
whitespace before the check so a valid, newline-terminated file is backed up
while a genuinely truncated one is still rejected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #120. The settings.json backup guard checked
tail -c1 == "}", but the file ends with}\n— so the last byte is a newline and the guard always skipped ("not }-terminated"), producing no backup. Verified live: the service logged the skip and no.bakwas created.Fix: strip trailing whitespace before the terminator check (
tail -c 64 | tr -d '[:space:]' | tail -c1), so a valid newline-terminated file is backed up while a genuinely truncated/mid-write file is still rejected. Logic tested.Docs/script only, no runtime/service change beyond the script contents. Applying just updates the script (no container bounce); I'll run the backup service once after to seed the first
.bak.