aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.41k stars 349 forks source link

auth: ignore vscode proxy errors on token refresh #5198

Closed nkomonen-amazon closed 2 weeks ago

nkomonen-amazon commented 2 weeks ago

Problem

We were seeing an error in aws_refreshCredentials metric. This error was networking related when the user has setup a proxy in vscode, but they were not connected to it. Maybe they didn't connect to VPN.

We typically catch network errors during the SSO token refresh process so that the session does not become invalidated on it. We do not catch all errors, but will add them in incrementally as we see them in telemetry. This proxy error was not caught and caused sessions to become invalidated prematurely.

Solution

Treat this VSCode Proxy Error as a network error so that we ignore it during token refresh, keeping the users session valid.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.