fix: loadCachedDb() before backfill to ensure in-mem nodedb isn't stale, show filtered count in nodelist#3827
Merged
jamesarich merged 8 commits intoNov 27, 2025
Conversation
…ction installConfig was being called with nodeDBbyNodeNum.values which only contained the ~80 nodes from firmware backfill. This caused it to overwrite existing node data in the database, clearing names of nodes that weren't in the backfill. Now installConfig is called with an empty node list, so it only updates myNodeInfo without touching node data. Individual nodes are already properly upserted via updateNodeInfo->nodeRepository.upsert.
mdecourcy
commented
Nov 26, 2025
…into fix/preserve-node-data-on-reconnection
…into fix/preserve-node-data-on-reconnection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes multiple issues where node data (names, positions, etc.) was being lost during device reconnection.
Changes
1. Fixed installConfig overwriting node names
Problem:
installConfigwas being called withnodeDBbyNodeNum.valueswhich only contained ~80 nodes from firmware backfill. This caused it to overwrite existing node data in the database, clearing names of nodes that weren't in the backfill.Solution: Call
installConfigwith an empty node list, so it only updatesmyNodeInfowithout touching node data. Individual nodes are already properly upserted viaupdateNodeInfo->nodeRepository.upsert.2. Fixed missing nodes after device switch
Problem: When switching devices,
discardNodeDB()cleared the in-memory cache but nodes weren't reloaded from the newly switched database.Solution: Call
loadSettings()(nowloadCachedDb()) after database switch to reload all nodes into memory before backfill runs.3. Added filtered node count display
Problem: Users couldn't easily tell if filters were hiding nodes vs nodes actually being lost.
Solution: Updated node list subtitle from
(X online / Y total)to(X online / Y shown / Z total)to clearly show how many nodes are filtered vs total.