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

Ignore tsserver requests for createDirectoryWatcher(~/Library) on macOS #227653

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

tmm1
Copy link
Contributor

@tmm1 tmm1 commented Sep 5, 2024

This is an attempt to mitigate microsoft/TypeScript#59831

Currently 6e8e175 fixes one specific symptom, causing macOS security dialogs

But a recursive directory watcher on ~/Library is still undesirable, as it results in events coming in for all sorts of files belonging to other apps. Combined with parcel-bundler/watcher#186, this results in VSCode making open calls to all sorts of sensitive files such as ~/Library/Safari/RecentlyClosedTabs.plist

Excessive watching under ~/Library also causes performance problems, and in some cases affects legitimate events flowing through. For example I have experienced my editor stops noticing changes to the git repo approximately ~3h after seeing the macOS security dialog.

//cc @bpasero

EDIT: without a proper fix it appears other prompts will get triggered
Screenshot 2024-09-04 at 6 10 44 PM

@mjbvz mjbvz self-assigned this Sep 5, 2024
@mjbvz mjbvz requested a review from bpasero September 5, 2024 00:25
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

Some feedback inline.

@bpasero bpasero self-assigned this Sep 5, 2024
@bpasero bpasero added this to the September 2024 milestone Sep 5, 2024
@bpasero bpasero merged commit 7bb0026 into microsoft:main Sep 5, 2024
6 checks passed
@@ -5,6 +5,7 @@

import * as path from 'path';
import * as vscode from 'vscode';
import { homedir } from 'os';
Copy link
Collaborator

@deepak1556 deepak1556 Sep 5, 2024

Choose a reason for hiding this comment

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

import breaks the web build, needs to update fallback in

    Module not found: Error: Can't resolve 'os' in '/mnt/vss/_work/1/s/extensions/typescript-language-features/src'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
	- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "os": false }
Details:
    domainEmitter: [object Object]
    domainThrown: false

Copy link
Member

Choose a reason for hiding this comment

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

Will check, I had a feeling this would break

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.

5 participants