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

Add test for fs.watch.spec.js #411

Closed
AHKol opened this Issue Sep 19, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@AHKol
Contributor

AHKol commented Sep 19, 2018

There is no test looking for a rename event for fs.watch() in fs.watch.spec.js

A test case for this may be almost identical to it('should get a change event when renaming a file', function(done) {

I would like to be assigned this issue.

@humphd

This comment has been minimized.

Contributor

humphd commented Sep 19, 2018

It's all yours @AHKol.

@humphd

This comment has been minimized.

Contributor

humphd commented Sep 19, 2018

Interestingly, I just took a look at the code. We don't currently support rename events at all with watchers. I can't recall why that is, whether a limitation in our implementation, or an oversight. At any rate, you should consider whether this is a good test to work on, since it would also require some code to get added to support rename events. I could guide you through the process if you want. Let me know.

@humphd

This comment has been minimized.

Contributor

humphd commented Sep 19, 2018

See also #68

@modeswitch

This comment has been minimized.

Member

modeswitch commented Oct 1, 2018

@humphd Watch events are weird in Filer to begin with because the same database can be accessed from multiple tabs, which don't know anything about each other. I think currently watch events are only triggered from activity in the tab where the watcher is created.

@humphd

This comment has been minimized.

Contributor

humphd commented Oct 1, 2018

Our watch events do work across windows, since we leverage cross-window (same-origin) localStorage events to emit them. I've used them in the past to have Brackets sessions in different tabs get updated when files "change on disk."

The issue here is that we just never bothered with renames. I can't remember why, and it might be that node itself sucks at this.

@modeswitch

This comment has been minimized.

Member

modeswitch commented Oct 1, 2018

Oh right, I remember now.

Yeah I don't recall why we didn't implement for rename.

@humphd humphd closed this in 8aa8dda Oct 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment