Skip to content

v0.1.8 — Heard Adverts

Choose a tag to compare

@laserir laserir released this 05 May 12:01
· 148 commits to main since this release

Highlights

Heard Adverts — every advert MeshCore decodes goes into a 64-entry LRU buffer (RAM, evaporates on reboot). New screen reachable from the admin menu lists them with type icons, last-heard age, alias-when-known, and a queued badge for entries you've saved this session. Detail modal shows fingerprint-style pubkey + per-hop path direction.

  • Live updates while the screen is visible: 1 Hz rate-limited rebuild, focus preserved by pubkey, skipped while a modal is open.
  • Save discovered chat contacts — Save button on the detail modal appends a from_discovery: true entry to config.json with conservative defaults (all permissions off, no SOS in/out). Activates on next boot via the existing ContactStore + MCLiteMesh registration path. CHAT-only — repeaters/rooms/sensors stay infrastructure. After save: [Reboot now, OK] confirmation.
  • Manual advert button in the header — sends a local advert immediately and re-anchors the periodic 9-min schedule. Toast confirms.
  • Clear button wipes the in-memory buffer.

Config persistence hardening

  • ConfigManager::save() now uses atomic writes: stage to .tmp, retain previous file as .bak during the rename, drop .bak on successful completion. Steady state is just config.json.
  • Boot fallback to config.json.bak if the live file is missing or corrupt (mid-save power loss). Successful recovery promotes the loaded content back to main and removes .bak.
  • Required because config.json holds the device identity keys — a torn truncate-write would brick the unit.

Other changes

  • Boot screen — MCLite mark glyph above the title, drawn programmatically (no raster asset).
  • Default dim_brightness 20 → 0 — auto-dim now goes fully dark, prevents long-term burn-in on the always-on status bar.
  • Long-standing log fix: [MCLiteMesh] Discovered contact was printing the raw packed path_len byte (low 6 bits = hops, upper 2 = hash size). Values like 70 actually meant 6 hops with 2-byte hashes. Now masked correctly.
  • Config tool: amber 'Added via device — review me' badge on from_discovery contacts, with an inline ✕ to mark reviewed. Round-trip preserves the flag on both load paths and the export builder.
  • i18n: 19 new keys covering type names, field labels, hops format, save/reboot/queue/error states, advert-sent toast — across en/de/fr/it and the embedded LANG_FILES.

Tests

  • 185 native test cases (was 172). New coverage in test_heard_advert_cache (14) and test_config (atomic writes, .bak fallback, recovery cleanup, from_discovery round-trip, append-discovered-contact success/duplicate/cap).

Compatibility

  • Backward-compatible config: missing from_discovery parses as false. Old firmware ignores the field.
  • ConfigManager now writes through the atomic path even for the existing offgrid-toggle save — no caller change needed.
  • To force first-boot regen, delete both config.json and config.json.bak.

Install

🤖 Generated with Claude Code