This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
fix: stale session ids being displayed in the attach to session dropdown #1727
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.
enterYourSessionId
was not getting displayed as we were setting the value to''
in case there are no running sessions, however, theantd
expects this value to beundefined
instead. For reference check this stackoverflow link.GET_SESSIONS_DONE
event is received for the first time we set theattachSessId
inside thestate
variable, however, for the subsequent occurrences of this event we never update thestate.attachSessId
as we had already set that once initially. This leads to stale sessions that are not running anymore and still getting listed. This stale entry is only removed if the user selects a valid entry from the dropdown so that theSET_ATTACH_SESS_ID
event is triggered which updates the value ofstate.attachSessId
, however, there could be scenarios where there are no running sessions anymore and therefore in this situation, there's no way to to get rid of this stale entry.isAttachSessIdValid
that validates whether the existing value ofstate.attachSessId
is any more valid or not? If it's not valid then we update its value with the currently running session id. If there are no running sessions currently then we reset the value tonull
(which is the initial state) so that the placeholder text starts getting displayed.