Files
MeshCore-Solo/examples
MarekZegare4 c917bf59fd fix(companion): atomic save for contacts/channels/prefs
saveContacts/saveChannels/savePrefs truncated the live file up front and
then wrote in place, so a crash, reset or full flash mid-save wiped the
whole file — observed as all contacts disappearing after a UI hang.

Write to a temp file and only swap it in (via LittleFS atomic rename) once
every record has written cleanly; on any failure keep the previous good
file and drop the temp. savePrefs gates the swap on the tail-sentinel write
succeeding (writes return 0 once flash fills, so a good sentinel means the
whole record fit). Contacts/channels live on the multi-MB QSPIFlash, so the
transient second copy fits easily.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:39:46 +02:00
..
2026-06-06 21:09:38 +10:00
2026-06-06 21:09:38 +10:00
2026-06-06 21:09:38 +10:00