NodeManager
Interface for managing the in-memory node database and processing received node information.
Properties
Whether node database writes are allowed.
Fresh-handshake identity for the current connection session. Null when no handshake identity has been confirmed for the active transport. Cleared synchronously before a new address is published, and populated atomically when handleMyInfo captures the selected address and decodes nodeNum and deviceId from the same MyNodeInfo packet. Generation-boundary cleanup atomically preserves an identity already published for the new session. Never populated by loadCachedNodeDB or reactive DB cache emissions.
The firmware edition reported by the connected device.
Whether the node database is ready.
The connected device's factory-burned hardware id from MyNodeInfo, as a thread-safe StateFlow. Null when not connected or when the hardware/firmware doesn't report one. Unlike myNodeNum (which firmware 2.8 re-derives from the public key), this survives upgrades, erases, and key changes.
Reactive map of all nodes by their number.
Whether the connected firmware reports NodeInfo.heard_on_current_lora. False until local metadata proves it, and false again on disconnect. Consumers of the unheard state (marker, banner, filter) gate on this rather than on the stored flag alone, so a stale false cannot surface while the database normalization is still in flight.
Functions
Applies a node the SDK session added (changed null) or updated after Ready. A user change routes through handleReceivedUser so identity correlation, retirement and the new-node notification apply; other fields merge only as far as changed names them, and never touch the app-owned link metrics.
Removes a node the SDK dropped after an acknowledged removeNode, ending any local removal waiting for it.
Applies node-number removals returned by the trusted configuration install. Removed numbers stay retired for the current device/database session so delayed field packets cannot recreate migrated identities.
Ends a removal the radio did not apply, so the node's next packet brings it back.
Clears the connection-session identity source synchronously.
Atomically clears an identity retained from a generation other than activeSessionGeneration. An identity that already belongs to the active generation is preserved, even when its publication races a delayed boundary collector from the same generation.
Returns information about the local node.
Look up a node by its user ID string (e.g. "!a1b2c3d4").
Processes a received node status message.
Processes a received paxcounter packet.
Processes a received position packet.
Processes a received user packet.
Inserts hardware metadata for a node.
Installs a node from an SDK handshake or NodeDB refresh snapshot in memory. The caller persists the whole snapshot through NodeRepository.installConfig.
Loads the cached node database from the repository.
Publishes a fresh connection-session identity from a handshake MyNodeInfo. Invoked exactly once per handshake after sessionGeneration, address, nodeNum, and deviceId have been captured for the same session.
Removes a node from the in-memory database by its number.
Sets whether node database writes are allowed.
Sets the firmware edition of the connected device.
Records the connected device's firmware version so node ingestion can gate on its capabilities. Passing null (a disconnect, or metadata not yet received) resets to the least-capable assumption.
Sets the connected device's hardware id.
Sets the local node number.
Sets whether the node database is ready.
Updates a node using a side-effect-free transform and schedules persistence. The transform may be evaluated more than once after compare-and-set contention; callers must perform notifications and other effects afterward.
Session-bound counterpart to updateNode; deferred persistence is admitted only for session.
Updates node status and awaits any required persistence.