Titanium JIRA Archive
Appcelerator Daemon (DAEMON)

[DAEMON-232] FSWatcher: Events relating to permission changes to a folder are dropped on Windows

GitHub Issuen/a
TypeBug
PriorityMedium
StatusResolved
ResolutionFixed
Resolution Date2018-03-22T14:05:50.000+0000
Affected Version/sAppc Daemon 1.1.0
Fix Version/sAppc Daemon 1.1.0
Componentsappcd-fswatcher
Labelsn/a
ReporterEwan Harris
AssigneeChris Barber
Created2018-02-08T17:49:54.000+0000
Updated2018-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 too

Steps to repro

TODO

Comments

  1. Chris Barber 2018-03-22

    https://github.com/appcelerator/appc-daemon/pull/302
  2. Chris Barber 2018-03-22

    To test: 1. Create a file called fstest.js in the appc-daemon\packages\appcd-fswatcher directory:
       const 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();
       
    2. Create a Desktop\foo\bar directory. 3. Run node fstest.js 4. In Windows Explorer, right click the foo 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.

JSON Source