Conversation

andyleejordan

This adds a simple lock to Logger.WriteLine since it's not re-entrant, hence we were losing logs. Now concurrent calls to it wait for each other to finish. It also should fix #4202, as the bug appears to be with the scheme used in globalStorageUri being vscode-userdata instead of file, and vscode.Uri.fsPath claiming it does not care about the scheme, but in fact essentially requires it to be file.

When we moved to using `globalStorageUri` and passing `vscode.Uri`s
around, we did not test UNC shares. It turns out that while
`vscode.Uri.fsPath`'s documentation says that it "does not look at
scheme," it actually does look at the scheme and essentially requires it
to be `file`. The scheme of the `globalStorageUri` however is
`vscode-userdata`, so the `fsPath` fails to then handle the UNC share
path. We are now replacing the scheme with `file` to get around this bug.
@andyleejordanandyleejordan requested a review from a team November 21, 2022 21:30
@ghost ghost added the Issue-BugA bug to squash.label Nov 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Well done getting this figured out ❤️

@andyleejordanandyleejordan merged commit d630e29 into main Nov 21, 2022
@andyleejordanandyleejordan deleted the andschwa/lock-logger branch November 21, 2022 21:51
Sign up for free to join this conversation on . Already have an account? Sign in to comment
Area-Logging Issue-BugA bug to squash.
None yet

Successfully merging this pull request may close these issues.

VSCode Extension v2022.8.5 initializes wrong user profile path