-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: FileNotFound error during SSO token refresh (#5392)
* refactor: increase scrubNames() file ext limit Problem: scrubNames() removes PII from a file path. There is also a limit to the file extension length of 4 characters. If the length is greater, the file ext is fully excluded. We have some scenarios in telemetry where the file has no file ext but we want to see it. A guess is that there are some cases where the file ext is longer than 4 chars. Solution: Show the file ext regardless of its length. Signed-off-by: Nikolas Komonen <[email protected]> * bug: rename() fails causing FileNotFoundError Problem: In our aws_refreshCredentials telemetry we saw a spike in FileNotFound errors when writing the refreshed token to our filesystem. This is caused by something in the vscode.workspace.fs.rename() implementation that is not obvious and does not seem like an obvious error on our end. Most of the time things work, so most users are not running in to this problem. Originally, to fix some errors happening during writing to the filesystem we created an "atomic" write, but there are edge cases where this did not work. So there are different implementations of writing a file that we used to rememdy this. Solution: Try the next fallback methods for saving the file to the file system when one fails. See the comment in the code for the explanation of the implementation. We also report telemetry on the specific failed cases to hopefully get a better understanding of the specific failures. We can use this Signed-off-by: Nikolas Komonen <[email protected]> * changelog items Signed-off-by: Nikolas Komonen <[email protected]> * add tests + logging Signed-off-by: Nikolas Komonen <[email protected]> --------- Signed-off-by: Nikolas Komonen <[email protected]>
- Loading branch information
1 parent
9b8f4d0
commit 3eb168d
Showing
6 changed files
with
116 additions
and
14 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/amazonq/.changes/next-release/Bug Fix-ceb237af-1d58-4560-9939-c07074eb3eee.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "Bug Fix", | ||
"description": "FileNotFound error causing early SSO expiration" | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
4 changes: 4 additions & 0 deletions
4
packages/toolkit/.changes/next-release/Bug Fix-04a6bfcb-9d56-4388-aadd-50e6c7db9670.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "Bug Fix", | ||
"description": "FileNotFound error causing early SSO expiration" | ||
} |