Skip to content

[Matter Direct] Recover CASE sessions after Thread Direct relink - #1282

Merged
Matthew Albert (malbert-silabs) merged 3 commits into
feature/matter-directfrom
feature/matter-direct-recover-case-td-link
Oct 20, 2026
Merged

Matthew Albert (malbert-silabs) merged 3 commits into
feature/matter-directfrom
feature/matter-direct-recover-case-td-link

Conversation

@malbert-silabs

Copy link
Copy Markdown
Contributor

Summary

After a peer reboot, the wake initiator can reuse a stale CASE session when the Thread Direct link reconnects, causing commands to fail.

  • Mark only the configured peer’s active CASE sessions defunct when a new TD link is established, before releasing queued work.
  • Let the next command establish or resume CASE through the existing binding flow
  • Fix a dangling reference into a temporary optional session handle.
  • Update the simplicity_sdk submodule with the latest TD implementation

Related issues

N/A

Testing

Switch/closure hardware retest passed.

Comment on lines +800 to +801
auto optionalSession = peer_device->GetSecureSession();
const SessionHandle & sessionHandle = optionalSession.Value();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for this split? if it is a optionalSession should we check that it has a values?
optionalSession.HasValue()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The split keeps the returned optional alive, avoiding a dangling reference after the semicolon. Both versions appeared to work in testing, but an LLM-assisted review flagged the lifetime issue.

I could add a HasValue() check, but I think it would be redundant as there is already a VerifyOrDie(HasValue()) inside Value(). If the intent is to handle a missing session gracefully, the earlier VerifyOrDie would also need to change.

@malbert-silabs
Matthew Albert (malbert-silabs) merged commit 0855d37 into feature/matter-direct Oct 20, 2026
4 of 15 checks passed
@malbert-silabs
Matthew Albert (malbert-silabs) deleted the feature/matter-direct-recover-case-td-link branch October 20, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants