SessionManagerImpl

In-memory implementation of SessionManager backed by an atomicfu-protected PersistentMap.

Per-node state replaces the single global passkey atomic that previously lived in CommandSenderImpl. Without this, bouncing remote-admin between two nodes within the firmware's 300 s TTL silently invalidated the first node's session because its passkey was overwritten by the second node's response.

Threshold rationale (see firmware/src/modules/AdminModule.cpp:1460-1481):

  • Firmware TTL = 300 s, with passkey rotation at the 150 s halfway mark on the next response sent.

  • We treat 240 s as the "active enough to navigate without refreshing" boundary to leave headroom for in-flight packets, mesh latency, and clock skew. A user navigated into the remote-admin screen at 299 s would otherwise immediately time out on the next request.

Constructors

Link copied to clipboard
constructor(clock: Clock)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val sessionRefreshFlow: SharedFlow<Int>

Functions

Link copied to clipboard
open override fun clearAll()
Link copied to clipboard
open override fun getPasskey(destNum: Int): ByteString
Link copied to clipboard
open override fun observeSessionStatus(destNum: Int): Flow<SessionStatus>
Link copied to clipboard
open override fun recordSession(srcNodeNum: Int, passkey: ByteString)