Skip to content

Fix infinite recursion in getDirectoryHandle #145972

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

Merged
merged 2 commits into from
Mar 24, 2022
Merged

Fix infinite recursion in getDirectoryHandle #145972

merged 2 commits into from
Mar 24, 2022

Conversation

kkocdko
Copy link
Contributor

@kkocdko kkocdko commented Mar 24, 2022

While opening the root dir (or disk root on windows), launch debug, getDirectoryHandle will try to find its parent dir. However dirname(root) returns root itself. This caused UI freezed on web target.

Add equal detection to fix this bug.

While opening the root dir (or disk root on windows), launch debug, `getDirectoryHandle` will try to find its parent dir. However `dirname(root)` returns root itself. This caused UI freezed on web target.

Add equal detection to fix this bug.
@kkocdko
Copy link
Contributor Author

kkocdko commented Mar 24, 2022

Bug reproduce:

  1. yarn web or server-win32-x64-web .
  2. Open a file in root directory.
  3. Press F5 to start debug.
  4. The UI freezed.
  • Here I insert some code to print value. As you see, it infinite recurse at root dir.
    image

  • If I wouldn't insert delay code
    image

@bpasero bpasero added this to the March 2022 milestone Mar 24, 2022
@bpasero bpasero merged commit 7046d66 into microsoft:main Mar 24, 2022
@bpasero
Copy link
Member

bpasero commented Mar 24, 2022

Thanks! Maybe file an issue to get this verified.

gabritto pushed a commit to gabritto/vscode that referenced this pull request Mar 25, 2022
While opening the root dir (or disk root on windows), launch debug, `getDirectoryHandle` will try to find its parent dir. However `dirname(root)` returns root itself. This caused UI freezed on web target.

Add equal detection to fix this bug.
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants