fix(#571): the admin save bar never appeared — f.internalShare #586
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-savebar"
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?
Found on the v0.6.212 dogfood: the sharing policy toggles moved but nothing saved, no save bar appeared, and the console carried
Load failed: f is not defined.One character.
loadSettingsValues()read the new switch offf— the parameter name ofsharingPolicyFromForm, eleven lines below — instead ofshp:The blast radius is the whole admin surface, not the sharing switch. That line sits near the top of the function, so the ReferenceError aborted everything below it: upload links, audit logging, OCM, download marking, retention, trash auto-purge, purge-after, both quotas, warn percent, lock max, notification and transfer retention, space folder locks. None of those got loaded — and none got
dataset.base.admDirtySync()diffs againstdataset.baseto count dirty fields, so with no baseline the count was always zero and no admin setting could be saved at all in v0.6.212. What the page displayed below that line was markup defaults, not stored state.Why the existing tests were green.
sharing-policy.test.jslifts the purepure:sharing-policyblock and exercises it hard, including four #571 cases for exactly this field — and the block is correct in both directions. The bug was in the DOM glue one line outside the fence. The comment above that block says a flipped negation "needs a test rather than a careful reader"; the same argument applies to the glue, and nothing covered it.New:
web/test/settings-load.test.js. LiftsloadSettingsValuesout of index.html, stubs$/api/retLoad/syncTrashAuto/GIB, and runs it. Four claims, the first two deliberately broader than this bug:set-*field it references, with the field list read from the source so the test does not go stale as fields are added — this is the one that would have caught the save-bar symptom rather than just the ReferenceError;Also straightened the indentation on the two
pure:block lines the same splice left at six spaces.Red witnessed: all four failed with
f is not definedbefore the fix; the workflow aborts if the test passes pre-fix. Green: all four pass, plus the other eleven web tests and the #389 extract gate.One process note: the first attempt died on my own post-condition, which asserted on the bare substring
" internalShare:". index.html legitimately carries that key at six spaces elsewhere, so the check failed on an unrelated line and the splice correctly wrote nothing. Tightened to full-line matches with their values. That is the third instance of the hazard already in the house notes — assert on the line, never on the word.