- Notifications
You must be signed in to change notification settings - Fork13.2k
Always recreate the file watcher when rename event occurs#48997
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…n that tests presence before creating fs watch
sheetalkamat commentedMay 6, 2022
@typescript-bot pack this |
typescript-bot commentedMay 6, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Heya@sheetalkamat, I've started to run the tarball bundle task on this PR at5dfdbdb. You can monitor the buildhere. |
sheetalkamat commentedMay 6, 2022
@MarcCelani-at Can you try the result of build from#48997 (comment) Its modified version of#47482 |
typescript-bot commentedMay 6, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@sheetalkamat, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build and annpm module you can use via |
…sappearance or appearance
sheetalkamat commentedMay 6, 2022
@typescript-bot pack this |
typescript-bot commentedMay 6, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Heya@sheetalkamat, I've started to run the tarball bundle task on this PR atbb32906. You can monitor the buildhere. |
typescript-bot commentedMay 6, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@sheetalkamat, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build and annpm module you can use via |
MarcCelani-at commentedMay 9, 2022
I can't verify this change in our mono repo because we use yarn3, which patches typescript at fixed versions. But I will test this on a small project on mac. |
MarcCelani-at commentedMay 9, 2022
I'm working on trying to repro this. There's a lot changing in our environment lately (just upgraded from node 12 to node 16) so its taking longer than it should, I think. |
jakebailey commentedMay 9, 2022
FWIW you can definitely use the above package with yarn 3; it'll cook up a new patched version for whichever version of TS you install, even if it's not one of the stable release versions. |
jakebailey commentedMay 9, 2022
To install PRs, we ask the bot to "pack this", which gives you something you can put into your See above:#48997 (comment) |
MarcCelani-at commentedMay 11, 2022
Sorry, this is taking awhile. We are still on 4.5.4 so I first had to get 4.6.4 working. It turns out this is really difficult in our monorepo environment because of a change that broke tsserver-bridge, details inmicrosoft/vscode#151245. I'm going to try to get this working without using tsserver-bridge in our monorepo. |
MarcCelani-at commentedMay 11, 2022
Okay, I have managed to repro the underlying issue on 4.6.4 in our monorepo without crashing the process from memory usage. Then, I upgraded to
|
MarcCelani-at commentedMay 11, 2022
ah it appears I need to test |
MarcCelani-at commentedMay 11, 2022
Ok, tried it again on |
sheetalkamat commentedMay 11, 2022
@MarcCelani-at did you see lines like: ``sysLog:: ${fileOrDirectory}:: Changing watcher to ...` what did they say.. Can you paste logs from that line by cleaning out private file paths to some random file paths |
typescript-bot commentedMay 23, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Heya@sheetalkamat, I've started to run the tarball bundle task on this PR atdd2164a. You can monitor the buildhere. |
typescript-bot commentedMay 23, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@sheetalkamat, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build and annpm module you can use via |
This reverts commitdd2164a.
sheetalkamat commentedMay 25, 2022
@typescript-bot pack this |
typescript-bot commentedMay 25, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Heya@sheetalkamat, I've started to run the tarball bundle task on this PR ate1ba8a8. You can monitor the buildhere. |
typescript-bot commentedMay 25, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey@sheetalkamat, I've packed this intoan installable tgz. You can install it for testing by referencing it in your and then running There is also a playgroundfor this build and annpm module you can use via |
This reverts commite1ba8a8.
sheetalkamat commentedMay 31, 2022
@amcasey@andrewbranch@jakebailey this is ready for review as@MarcCelani-at confirmed offline that this is working |
jakebailey commentedMay 31, 2022
As in, there's no event for |
sheetalkamat commentedMay 31, 2022
when event occurs on fileNameWithExtension the relative file name in the event is
We received the reports but never concrete repro to see this. Eg on linux vm the tilda thing never came up as part of events and it was working even before that extra commit. In practice we use |
jakebailey commentedJun 6, 2022
I see; I was just trying to think of an edge case where this method wouldn't be good, but I suppose at worst, it means we look at the non-
Just so I understand, do you mean that |
jakebailey commentedJun 6, 2022
Okay, I had a change to review all of the commits individually; the first ones all are cleanups and move to baselines that look good to me. The "actual fix" stuff at the end also looks reasonable, so I'm okay with this change (if everyone else is confident), pending my small questions above. I don't really know if I should be trying to reproduce the core issue or not here to really verify, or if we can just wait for feedback if this breaks people on nightly. |
sheetalkamat commentedJun 6, 2022
When i reproed the scenario - vim edit and save on ubuntu vm, i didnt get the I think its reasonable to try it out and seek feedback, Our default is to watch files using polling and not using file system events.. So when we added |
Uh oh!
There was an error while loading.Please reload this page.
Sometimes file appears before the callback is processed and that results in watching wrong inode.
So on every rename event we are recreating the file watcher (which was intention of the existing code by checking fileExists but now the presence check merely determines which kind of watcher is created)
Actual change is in5dfdbdb andbb32906
Apart from this it is also noticed that when files are edited with vim, the rename event occurs for
fileNameWithExtension~so that is handled as if the event has occured forfileNameWithExtension. Fixed in8e036e5884678e converts all watch related tests to baselines so its easier to reason about
03fa5b3 adds inode watching test by refactoring how sys does fsWatch so that we can test that functionality
c7bbb97 allows to take map of files instead of array when creating test host for watch
189bbc2 test that shows the rename issue
5dfdbdbbb329068e036e5 Actual fix
Fixes#47466 (Repro per#47466 (comment))