mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
NodePrefs is written/read field-by-field in DataStore::savePrefs/loadPrefsInt; the on-disk format is the struct's field layout, with nothing checking that the two hand-written sequences still match the struct. A forgotten read/write silently misaligns every later field — the highest-blast-radius convention in the codebase. Add a static_assert on sizeof(NodePrefs): changing a data member trips it with a checklist (sync save/load, clamp on load, bump SCHEMA_SENTINEL, update the size). A manual checkpoint, not a proof, but it turns silent drift into a build break. Size is variant-stable (all arrays sized by NodePrefs' own constants), verified on both nRF52 boards. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>