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

Avoid using chokidar (Fix #762) #763

Merged
merged 3 commits into from
Feb 11, 2019

Conversation

nekonenene
Copy link
Contributor

@nekonenene nekonenene commented Feb 8, 2019

Short description of what this resolves:

Fix "Extension host terminated unexpectedly" in Visual Studio Code v1.31.0 with Settings Sync.
( microsoft/vscode#64981 )

sc 617

dyld: lazy symbol binding failed: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
  Referenced from: /Users/xxx/.vscode/extensions/shan.code-settings-sync-3.2.5/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node
  Expected in: flat namespace

It causes by fsevents, also chokidar.
microsoft/vscode#65335

So, I remove chokidar from this repository, and use FileSystemWatcher .

Thanks: fabiospampinato/vscode-projects-plus@8357ab7#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

Changes proposed in this pull request:

  • Remove chokidar
    • disable depth setting because use FileSystemWatcher (sorry...)
  • Update install_local.txt

Fixes: #762

How Has This Been Tested?

  • Put console.log to check if pass through StartWatch, onDidChange, CloseWatch.
  • Update locale.json (vscode setting), and see starting to upload. Check the gist file if update correctly.
  • Update that 5 times, and every upload successfully finished.

Screenshots (if appropriate):

Checklist:

  • I have read the contribution guidelines.
  • My change requires a change to the documentation and GitHub Wiki.
  • I have updated the documentation and Wiki accordingly.

ignoreInitial: true
});
Commons.configWatcher = chokidar.watch(this.en.PATH + "/User/", {
depth: 2,
Copy link
Owner

Choose a reason for hiding this comment

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

How are you handling the depth as 2 in File System Watcher

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean the watcher should not watch under directories in workspaceStorage.
OK, I'll try handling it! Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shanalikhan
Fixed by 758baf7
But it's not beautiful way... umm...

});
Commons.configWatcher = chokidar.watch(this.en.PATH + "/User/", {
depth: 2,
ignoreInitial: true
Copy link
Owner

Choose a reason for hiding this comment

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

It would be great if you can write details how are you handling these situations on FileSystemWatcher

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The watcher doesn't watch the add event now, so I think it's not problem to ignore this option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now, I checked this behavior.
FileSystemWatcher and chokidar with ignoreInitial: true are same. 😄

Add the following code for check, and Added: logs are not appeared when the window reloads.

    Commons.configWatcher.onDidCreate(async (uri: vscode.Uri) => {
      const path: string = uri.path;
      console.log("Added: " + path);
    });

I also checked the case of ignoreInitial: false. nekonenene@5941286

sc 619

@fuzzy76
Copy link

fuzzy76 commented Feb 9, 2019

A much easier fix would be to bump chokidar to 2.1.0, as the problem is fixed in that release.

@nekonenene
Copy link
Contributor Author

nekonenene commented Feb 9, 2019

@fuzzy76
Did you rebuild and install code-settings-sync, and launch Visual Studio Code 1.31.0?
I already tried, and it causes the error sadly. 😢 ( #762 (comment) )

@shanalikhan
Copy link
Owner

It would personally recommend using vscode own file change events rather chokidar, when i developed this feature there were no api developed by code team thats why Settings Sync is using chokidar itself.

If new update of chokidar fix this problem, send new PR and i will accept that to push new version.
Meanwhile, i will test it and merge it soon.

@nekonenene
Copy link
Contributor Author

@shanalikhan Thanks! So, should i close this PR?

@shanalikhan
Copy link
Owner

No, Keep this open, I will merge it soon.

@shanalikhan shanalikhan merged commit 32af454 into shanalikhan:v3.2.5 Feb 11, 2019
@nekonenene
Copy link
Contributor Author

Oh, I misunderstood your comment.

I hope that fsevents will update, and merge to chokidar. Thank you for merge.

@nekonenene
Copy link
Contributor Author

Note: chokidar v2.1.1 is released yesterday, but, it includes fsevents v1.2.7 same as v2.1.0. I tried v2.1.1, and error occured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants