fix(meshcore): preserve node name on empty advert + mute route/scope colors#3772
fix(meshcore): preserve node name on empty advert + mute route/scope colors#3772Yeraze wants to merge 2 commits into
Conversation
…as clearly secondary (#3769) Route and scope lines are secondary metadata and should be visually less prominent than the timestamp. Moving them from ctp-overlay0 to ctp-surface2 (one step more muted in both dark and light Catppuccin themes) creates the expected visual hierarchy: message text > sender/time > route/scope. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uH3HqQC4r4x7TRqhLTbc3
…name (#3756) Zero-hop repeaters send contact_advertised with adv_name as an empty string. The nullish-coalescing operator (??) used to merge names only falls back on null/undefined, so "" was overwriting the stored name. Changed ?? to || in both the in-memory contact update and the persistContact DB write so empty strings are treated as "not observed" and the previously stored name is preserved. Regression test added to meshcoreManager.contactPersistence.test.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uH3HqQC4r4x7TRqhLTbc3
|
Claude finished @Yeraze's task —— View job PR Review
Overall AssessmentBoth fixes are correct, well-scoped, and safe to merge. No issues found that would block approval. Fix 1: Node name preservation (
|
| Area | Status |
|---|---|
| Root cause analysis | Correct |
| Fix implementation | Correct |
| CSS change | Correct |
| Regression test | Good coverage |
| No security concerns | ✓ |
| No performance concerns | ✓ |
|
Superseded. The #3769 metadata-contrast half of this PR already shipped in #3778 (time/route/scope set to |
Summary
Two small bug fixes from today's issue triage:
Fix 1: Preserve node name when advert has empty
adv_name(#3756)Root cause:
contact_advertisedevents from zero-hop repeaters arrive withadv_nameas an empty string"". The code used??(nullish coalescing) to merge names:Since
""is notnull/undefined, the empty string won overwrote the stored name. The same value then propagated throughpersistContactinto the DB (theupsertNodemerge guard explicitly keeps''as a valid update).Fix: Change
??to||in both the in-memory merge and thepersistContactname field so empty strings fall back to the existing value, the same waynull/undefinedalready did.Test: New regression test in
meshcoreManager.contactPersistence.test.ts— dispatches a named advert followed by an empty-name advert for the same key and asserts both the in-memory contact and the DB call preserve the original name.Fix 2: Route/scope metadata colors more subdued (#3769)
Route and scope lines in MeshCore messages were using
--ctp-overlay0(same shade as the timestamp). For secondary metadata they should be quieter. Moved to--ctp-surface2(one step more muted in both dark and light Catppuccin themes):--ctp-text--ctp-text--ctp-overlay0--ctp-overlay0--ctp-overlay0--ctp-surface2←Test plan
meshcoreManager.contactPersistence.test.ts— all 10 tests pass including new regression🤖 Generated with Claude Code
https://claude.ai/code/session_016uH3HqQC4r4x7TRqhLTbc3
Generated by Claude Code