Save a setting switched off when nothing was saved before #88
Loading…
Reference in a new issue
No description provided.
Delete branch "patrick/settings-save-falsy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug from #84, found on Dallas: turning Tracing off in Platform Settings stored nothing, so Horizon kept restarting with the chart's
TRACING_ENABLED=trueand crash-looping (the leak #86 fixes).Cause: a changed value was written only when it differed from the saved one, compared with PHP's loose
!=. With no saved row,false != nullis false, so switching off any setting the deployment turns on was silently dropped. The page applied it for that one request, so it looked saved.Fix
sameSettingValue()replaces the loose comparisons: unset matches only unset orfalse(a toggle can't show "unset", so off and unset are the same), and0is a real value rather than "nothing".Checked: new test reproduces Dallas (tracing on by deployment, switched off, survives a worker reboot) and fails on the old code; plus a toggle switched on where the deployment sets nothing. Full suite: 518 passed, 8 skipped. Pint clean.
🤖 Generated with Claude Code