[DAEMON-232] FSWatcher: Events relating to permission changes to a folder are dropped on Windows
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2018-03-22T14:05:50.000+0000 |
Affected Version/s | Appc Daemon 1.1.0 |
Fix Version/s | Appc Daemon 1.1.0 |
Components | appcd-fswatcher |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Chris Barber |
Created | 2018-02-08T17:49:54.000+0000 |
Updated | 2018-03-22T14:05:50.000+0000 |
Description
Description
In DAEMON-222 changed were made to prevent unnecessary change events (a child item changing for example) on a folder bubbling up, which had the side-effect of causing any change events to not fire for a folder on Windows. The current solutions for tracking information through fs.Stats is lightweight on Windows a potential native module (https://github.com/xxoo/node-fswin) was found but the heaviness of using this module wasn't wanted. This is more than likely going to need to be sovled in the future It's probable that issues relating to permissions will be prevalent on unixy systems tooSteps to repro
TODOComments
- Chris Barber 2018-03-22 https://github.com/appcelerator/appc-daemon/pull/302
- Chris Barber 2018-03-22
To test:
1. Create a file called
fstest.js
in theappc-daemon\packages\appcd-fswatcher
directory:
2. Create aconst fsw = require('./dist/index'); const renderTree = fsw.renderTree; const FSWatcher = fsw.FSWatcher; const watcher = new FSWatcher('C:\\Users\\chris\\Desktop', { recursive: true }); watcher.on('change', evt => { console.log(evt); setTimeout(() => { console.log(renderTree()); console.log(); }, 100); }); console.log(renderTree()); console.log();
Desktop\foo\bar
directory. 3. Runnode fstest.js
4. In Windows Explorer, right click thefoo
directory and go to Properties, then click on the Security tab. Click the Edit button and select your user from the list. Start twiddling permissions and clicking the Apply button as you watch the events being emitted.