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
Open
fix(devices): show Connect button after disconnect and refresh auth token on reconnect#3159nmgaston wants to merge 2 commits intodevice-management-toolkit:mainfrom
nmgaston wants to merge 2 commits intodevice-management-toolkit:mainfrom
Conversation
86e05bb to
c03cdf4
Compare
…oken on reconnect
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.
NOTE: Use with Console PR: device-management-toolkit/console#820
PR Checklist
What are you changing?
Fixes the KVM Connect button not reappearing after an unexpected AMT disconnect.
kvm.component.html: Updated the Connect button condition fromdeviceState() === 0to(deviceState() === 0 || !deviceKVMConnection()) && !isLoading()so the button is shown whenever the KVM is not connected, regardless of device state.kvm.component.ts:deviceKVMStatus(0): AddeddeviceKVMConnection.set(false)when AMT drops the connection unexpectedly, so the UI correctly reflects the disconnected state.connect(): ResetsreadyToLoadKvmanddeviceKVMConnectiontofalsebefore reconnecting, and refreshes the auth token viagetRedirectionExpirationTokenin case it expired.Anything the reviewer should know when reviewing this PR?
The root cause was that after an unexpected KVM disconnect (event
0not triggered by the user),deviceKVMConnectionremainedtrue, 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
deviceStatehasn't yet been set to0but 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 )