-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Remove PPromise usage from NSFW IPC #53556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomoreno left some comments but could not test after all due to this error:
ERR event is not a function: TypeError: event is not a function
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:441:20
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/event.js:441:20
at FileWatcher.startWatching (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/services/files/node/watcher/nsfw/watcherService.js:51:13)
at RemoteFileService.FileService.setupFileWatching (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/services/files/electron-browser/fileService.js:149:99)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/services/files/electron-browser/fileService.js:90:23
at Object.notifySuccess [as _notify] (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1191:59)
at Object.enter (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:867:30)
at Promise_ctor._run (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1089:29)
at Promise_ctor._completed (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1057:18)
at Barrier.open (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/async.js:339:18)
at LifecycleService.set [as phase] (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/platform/lifecycle/electron-browser/lifecycleService.js:95:54)
at file:///Users/bpasero/Development/Microsoft/monaco/out/vs/workbench/electron-browser/shell.js:70:50
at _Base.Class.derive._creator.CompletePromise_done [as done] (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1545:34)
at Object.notifySuccess [as _notify] (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1201:48)
at Object.enter (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:867:30)
at Promise_ctor._run (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1089:29)
at Promise_ctor._completed (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1057:18)
at argDone (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1834:37)
at Promise.then.errors.(anonymous function) (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1859:78)
at Object.notifySuccess [as _notify] (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1191:59)
at Object.enter (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:867:30)
at _Base.Class.derive._creator._run (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1089:29)
at _Base.Class.derive._creator._completed (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1057:18)
at _Base.Class.derive._creator.CompletePromise_then [as then] (file:///Users/bpasero/Development/Microsoft/monaco/out/vs/base/common/winjs.base.js:1587:49)
src/vs/base/common/errors.ts
Outdated
@@ -242,6 +242,10 @@ export interface IErrorWithActions { | |||
actions?: IAction[]; | |||
} | |||
|
|||
export function isError(obj: any): obj is Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomoreno this seems unrelated? and should also not really be needed with TypeScript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was referencing the wrong one...
@@ -79,6 +79,9 @@ export class Client implements IChannelClient, IDisposable { | |||
private _client: IPCClient; | |||
private channels: { [name: string]: IChannel }; | |||
|
|||
private _onDidProcessExit = new Emitter<{ code: number, signal: string }>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomoreno _onDidProcessExit
is never getting disposed
}); | ||
return this._watcherPromise; | ||
watch(options: IWatcherOptions): Event<watcher.IRawFileChange[] | Error> { | ||
this._verboseLogging = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomoreno looks like this should be this._verboseLogging = options.verboseLogging
(I broke this a long time ago via 38220e3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, thought you did that on purpose.
@@ -16,15 +15,16 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace | |||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; | |||
import { IDisposable, dispose } from 'vs/base/common/lifecycle'; | |||
import { Schemas } from 'vs/base/common/network'; | |||
import { isPromiseCanceledError } from 'vs/base/common/errors'; | |||
import { filterEvent } from 'vs/base/common/event'; | |||
import { isError } from 'util'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomoreno did you mean to use errors.isError
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YEAH!
Pushed review comment changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaomoreno I tested basic things like file changes and simulating a crash of the watcher and it works fine. however this does not work: if I manually trigger the ENOSPC error after a short timeout from here I do not get a notification. Compared to stable:
Great catch. Pushed fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Related to #53487
@bpasero This removes PPromise usage from the NSFWWatcherService. Give it a good test drive, especially wrt the process crashing and restarting everything again. Everything should work as before.
If good, I'll make exactly the same adoption for Chokidar, since both worlds seem identical.