Skip to content

fix: skip default nodeinfo upsert in handleReceivedUser for live packets#3819

Merged
DaneEvans merged 2 commits into
meshtastic:mainfrom
mdecourcy:fix/skip-nodeinfo-upsert-live-packets
Nov 26, 2025
Merged

fix: skip default nodeinfo upsert in handleReceivedUser for live packets#3819
DaneEvans merged 2 commits into
meshtastic:mainfrom
mdecourcy:fix/skip-nodeinfo-upsert-live-packets

Conversation

@mdecourcy

Copy link
Copy Markdown
Contributor

Extends the fix from commit 5520978 to also protect handleReceivedUser(), which processes live NODEINFO_APP packets from the mesh.

The original fix only protected installNodeInfo() (initial device sync), but live NodeInfo packets were still overwriting user data through handleReceivedUser() without any protection against default names.

Changes:

  • Extract duplicate logic into shouldPreserveExistingUser() helper function
  • Apply same protection to handleReceivedUser() for live packet handling
  • Refactor installNodeInfo() to use shared helper, eliminating duplication

This ensures that when firmware's NodeDB evicts a node and later re-creates it with default info ("Meshtastic XXXX", hwModel=UNSET), the app detects this in both code paths and preserves existing user data instead of overwriting it.

Fixes issue where user names were still being reset to defaults despite the original fix

@mdecourcy mdecourcy marked this pull request as ready for review November 26, 2025 03:14
@github-actions github-actions Bot added the bugfix PR tag label Nov 26, 2025
@DaneEvans DaneEvans added this pull request to the merge queue Nov 26, 2025
Merged via the queue into meshtastic:main with commit f966ab1 Nov 26, 2025
5 checks passed
@codecov

codecov Bot commented Nov 26, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.54%. Comparing base (5520978) to head (8f2b816).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...in/java/com/geeksville/mesh/service/MeshService.kt 0.00% 26 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3819      +/-   ##
========================================
- Coverage   0.56%   0.54%   -0.02%     
========================================
  Files        381     386       +5     
  Lines      21747   22493     +746     
  Branches    2687    2821     +134     
========================================
  Hits         122     122              
- Misses     21605   22350     +745     
- Partials      20      21       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this to the 2.7.8 milestone Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants