Repository navigation
fix(data): bind admin writes to the transport session they were issued under - #7964
Merged
Merged
Conversation
…d under An admin write carries one session's passkey, but the outbound path only checked that a radio was connected, so a write queued behind a radio switch could leave through the replacement transport. sendAdmin and sendAdminAwaitResult now carry the lifecycle version current at the call, and editSettings carries one version through begin, every write and the commit; a stale version is rejected like a disconnect.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
jamesarich
marked this pull request as ready for review
November 8, 2026 19:09
jamesarich
enabled auto-merge
November 8, 2026 19:11
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.
An admin write carries the passkey of one transport session, but the outbound path only checked "radio is connected" at admission and dispatch. A write queued behind a radio switch could go out through the replacement transport, addressed to the old radio's node number. The queue already honors
ConnectionLifecycle.versionfor callers that pass it (sendAdminForConnection, used by the post-handshake seed); the rest of the admin path did not.🔧 Changes
CommandSender.sendAdminandsendAdminAwaitResultbind to the lifecycle version current at the call; a stale version is rejected at admission or dispatch like a disconnect (PacketQueueRejectedException, or a non-acceptedTRANSPORT_STOPPEDresult).editSettingscaptures one version at entry and carries it through begin, every write and the commit, so a switch mid-transaction rejects the rest instead of splitting it across radios.sendAdminAwaitResultForConnectiononCommandSenderandsendToRadioAndAwaitResultForConnectiononPacketHandlerfor the awaited path;sendAdminImmediatestays unbound because it exists for mid-handshake sends.versionbumps on every state change, so a queued admin write no longer survives a disconnect/reconnect on the same radio either; the caller sees the failed save.✅ Testing Performed
CommandSenderImplTest:sendAdminandsendAdminAwaitResultforward the current version; the explicit variant forwards the caller's.PacketHandlerImplTest: an awaited send captured under a stale version reportsTRANSPORT_STOPPEDwithout dispatching.RadioControllerImplTest: begin, writes and commit all carry the entry version after the transport moved on.Closed structurally; the window was not reproduced on a bench.