Skip to content

fix(devices): show Connect button after disconnect and refresh auth token on reconnect#3159

Open
nmgaston wants to merge 2 commits intodevice-management-toolkit:mainfrom
nmgaston:fixKVMDisconnectStatus
Open

fix(devices): show Connect button after disconnect and refresh auth token on reconnect#3159
nmgaston wants to merge 2 commits intodevice-management-toolkit:mainfrom
nmgaston:fixKVMDisconnectStatus

Conversation

@nmgaston
Copy link
Contributor

@nmgaston nmgaston commented Mar 3, 2026

NOTE: Use with Console PR: device-management-toolkit/console#820

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

Fixes the KVM Connect button not reappearing after an unexpected AMT disconnect.

  • kvm.component.html: Updated the Connect button condition from deviceState() === 0 to (deviceState() === 0 || !deviceKVMConnection()) && !isLoading() so the button is shown whenever the KVM is not connected, regardless of device state.
  • kvm.component.ts:
    • deviceKVMStatus(0): Added deviceKVMConnection.set(false) when AMT drops the connection unexpectedly, so the UI correctly reflects the disconnected state.
    • connect(): Resets readyToLoadKvm and deviceKVMConnection to false before reconnecting, and refreshes the auth token via getRedirectionExpirationToken in case it expired.

Anything the reviewer should know when reviewing this PR?

The root cause was that after an unexpected KVM disconnect (event 0 not triggered by the user), deviceKVMConnection remained true, causing the Connect button to stay hidden. The fix ensures the signal is always in sync with the actual connection state.

The Connect button condition also now covers the case where deviceState hasn't yet been set to 0 but the connection is known to be down.

If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )

@nmgaston nmgaston force-pushed the fixKVMDisconnectStatus branch from 86e05bb to c03cdf4 Compare March 3, 2026 02:20
@nmgaston nmgaston changed the title fix(kvm): show Connect button after disconnect and refresh auth token on reconnect fix(devices): show Connect button after disconnect and refresh auth token on reconnect Mar 3, 2026
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.

Console UI does not reflect KVM disconnect after AMT closes idle session (~3 minutes inactivity)

1 participant