Skip to content

Comments

serviceability: require Activated status for UnlinkDeviceInterface#2871

Merged
martinsander00 merged 1 commit intomainfrom
ms/2230
Feb 17, 2026
Merged

serviceability: require Activated status for UnlinkDeviceInterface#2871
martinsander00 merged 1 commit intomainfrom
ms/2230

Conversation

@martinsander00
Copy link
Contributor

@martinsander00 martinsander00 commented Feb 9, 2026

Resolves: #2230

Summary

  • UnlinkDeviceInterface now restricts which interface statuses can be unlinked: only Activated and Pending are allowed (previously all statuses except Deleting were accepted)
  • When unlinking an Activated interface, an optional link account can be provided; if present, the link must be in Deleting status, ensuring interfaces are only unlinked as part of proper link teardown
  • SDK UnlinkDeviceInterfaceCommand automatically discovers associated link accounts by scanning onchain link data for side-A/side-Z matches, and passes them to the instruction

Testing Verification

  • Added dedicated unlink_device_interface_test.rs with comprehensive coverage: unlink from Pending, unlink from Activated with valid Deleting link, rejection of unlink from Linked/Unlinked/Deleting statuses, rejection when link is not in Deleting status, and rejection when link doesn't reference the device/interface

@martinsander00 martinsander00 force-pushed the ms/2230 branch 3 times, most recently from cf57abf to 24fb589 Compare February 13, 2026 22:39
@martinsander00 martinsander00 force-pushed the ms/2230 branch 2 times, most recently from d5d3fca to 1c31228 Compare February 13, 2026 22:46
Copy link
Contributor

@elitegreg elitegreg left a comment

Choose a reason for hiding this comment

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

Good fix, but please use case-insensitive comparison on interface names. We do normalize the names, but there exists some early devices on mainnet that were configured before interface name normalization that won't match unless you use case-insensitivity.

@martinsander00 martinsander00 merged commit 2c606f5 into main Feb 17, 2026
30 checks passed
@martinsander00 martinsander00 deleted the ms/2230 branch February 17, 2026 19:35
nikw9944 pushed a commit that referenced this pull request Feb 20, 2026
…2871)

Resolves: #2230

## Summary
- `UnlinkDeviceInterface` now restricts which interface statuses can be
unlinked: only `Activated` and `Pending` are allowed (previously all
statuses except `Deleting` were accepted)
- When unlinking an `Activated` interface, an optional link account can
be provided; if present, the link must be in `Deleting` status, ensuring
interfaces are only unlinked as part of proper link teardown
- SDK `UnlinkDeviceInterfaceCommand` automatically discovers associated
link accounts by scanning onchain link data for side-A/side-Z matches,
and passes them to the instruction

## Testing Verification
- Added dedicated `unlink_device_interface_test.rs` with comprehensive
coverage: unlink from Pending, unlink from Activated with valid Deleting
link, rejection of unlink from Linked/Unlinked/Deleting statuses,
rejection when link is not in Deleting status, and rejection when link
doesn't reference the device/interface
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.

In UnlinkDeviceInterface, verify that iface.status == Activated

2 participants