Files
silo-server/web
Quick 4b665add64 fix(autoscan): stop infinite render loop in scan-source config form
Reported from production: React error #185 (maximum update depth) on
/admin/autoscan, thrown from a config form button.

SchemaForm reports validity from an effect keyed on [valid, onValidityChange].
The validity wiring added in the previous commit passed an inline arrow, so the
callback had a fresh identity every render; its setState re-rendered the parent,
which produced another new arrow, and so on. The source row compounded it by
rebuilding the descriptor object inline to hide the built-in webhook provider
field, invalidating SchemaForm's memos on every pass too.

Fixed at both ends. SchemaForm now holds the callback in a ref and reports only
on an actual transition, so no caller can reintroduce this — it is shared with
AdminRequests, which passes an inline arrow as well. The autoscan call sites
additionally memoize the trimmed descriptor and their callbacks, and skip the
state write when validity is unchanged.

Verified in a browser against the descriptor shape that crashed (CephFS with a
required field): no error, and the required-field gating still works. Added
SourceConfigForm.test.tsx covering the loop; without the guard it hangs rather
than completing.
2026-07-29 14:52:16 -04:00
..
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00