Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crash when cloud shell provider timed out or was closed waiting for login #16364

Merged

Conversation

reynoldsa
Copy link
Contributor

@reynoldsa reynoldsa commented Nov 23, 2023

Summary of the Pull Request

Cloud shell connection calls out to Azure to do a device code login. When the polling interval is exceeded or the tab is closed, the method doing the connection polling returns nullptr, and AzureConnection immediately tries to GetNamedString from it, causing a crash. This doesn't repro on Terminal Stable or Preview, suggesting it's pretty recent related to the update of this azureconnection.

This is just a proposed fix, not sure if you want to do more extensive changes to the affected class or not, so marking this as a draft.

References and Relevant Issues

  • N/A - encountered this while using the terminal myself

PR Checklist/Validation

Tested out a local dev build:

  • Terminal doesn't crash when cloudshell polling interval exceeded
  • Terminal doesn't crash when cloudshell tab closed while polling for Azure login

@reynoldsa reynoldsa marked this pull request as ready for review November 24, 2023 15:52
@reynoldsa
Copy link
Contributor Author

Thanks @lhecker - lmk if I need to fill out anything else to get it merged, or if you're taking it from here.

@zadjii-msft zadjii-msft merged commit 0c4751b into microsoft:main Nov 30, 2023
12 of 14 checks passed
DHowett pushed a commit that referenced this pull request Dec 4, 2023
… for login (#16364)

## Summary of the Pull Request
Cloud shell connection calls out to Azure to do a device code login.
When the polling interval is exceeded or the tab is closed, the method
doing the connection polling returns `nullptr`, and `AzureConnection`
immediately tries to `GetNamedString` from it, causing a crash. This
doesn't repro on Terminal Stable or Preview, suggesting it's pretty
recent related to the update of this azureconnection.

This is just a proposed fix, not sure if you want to do more extensive
changes to the affected class or not, so marking this as a draft.

## References and Relevant Issues
* N/A - encountered this while using the terminal myself

## PR Checklist/Validation
Tested out a local dev build:

- [x] Terminal doesn't crash when cloudshell polling interval exceeded
- [x] Terminal doesn't crash when cloudshell tab closed while polling
for Azure login

(cherry picked from commit 0c4751b)
Service-Card-Id: 91232784
Service-Version: 1.19
DHowett pushed a commit that referenced this pull request Jan 23, 2024
… for login (#16364)

## Summary of the Pull Request
Cloud shell connection calls out to Azure to do a device code login.
When the polling interval is exceeded or the tab is closed, the method
doing the connection polling returns `nullptr`, and `AzureConnection`
immediately tries to `GetNamedString` from it, causing a crash. This
doesn't repro on Terminal Stable or Preview, suggesting it's pretty
recent related to the update of this azureconnection.

This is just a proposed fix, not sure if you want to do more extensive
changes to the affected class or not, so marking this as a draft.

## References and Relevant Issues
* N/A - encountered this while using the terminal myself

## PR Checklist/Validation
Tested out a local dev build:

- [x] Terminal doesn't crash when cloudshell polling interval exceeded
- [x] Terminal doesn't crash when cloudshell tab closed while polling
for Azure login

(cherry picked from commit 0c4751b)
Service-Card-Id: 91232783
Service-Version: 1.18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants