Join GitHub today
ExternalEditWatcher displays incorrect status #1614
Sometimes when the external edit file is saved by a mainstream editor (like vim or emacs, and maybe even gedit), the ExternalEditWatcher loses track of the file via an unlink event (#710, #766, discourse). The external edit button still displays "Watching", but no new changes are detected.
I see several possible solutions
I'd be happy to take a shot at making a PR to fix this, but I have two questions:
We might be able to replicate it consistently in an automated way with something like this: ``` mv some.md some.md.swp && sleep .1 && mv some.md.swp some.md ``` (from paulmillr/chokidar#35 (comment))…
On Sun, Jun 9, 2019 at 4:28 AM Laurent Cozic ***@***.***> wrote: I guess we should indeed show that it's no longer watching the file, but should also try to fix the bug. The issue is that it's hard to replicate. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#1614?email_source=notifications&email_token=ABALI24UIVU7INFFZ3FUZTLPZTSNXA5CNFSM4HSA5DFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXIIKSQ#issuecomment-500204874>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABALI277JYKHL2O2GEFCRIDPZTSNXANCNFSM4HSA5DFA> .
Did you report this issue on the Chokidar repo?
On Windows, when I delete the file, then recreate it after a second I see it does this:
So it seems to add the file back automatically, or maybe it never actually stops watching it. That behaviour seems to happen too on Linux but just not all the time, so it could be something to fix on the Chokidar package.
Hi @laurent22, no, I did not file on chokidar because I didn't have time to figure out if it was a previously reported issue, though I agree that the root problem should be fixed there or even further upstream (that's why this issue has a title about the UI displaying incorrect status).
Yeah, I think it might happen more often when the delay is shorter - like a few ms. See also paulmillr/chokidar#35 (comment).
I'll try to look at #1659 sometime in the next few days and see if it fixes it for me.