appnexus / sicksync

Don’t accept the available as the preferable. Go the extra mile with extra speed.
Apache License 2.0
68 stars 11 forks source link

File deletion errors #53

Closed laggingreflex closed 7 years ago

laggingreflex commented 7 years ago

File deletions are causing errors

Here the file is simply deleted:

[APP] [PC] > unlink C:\.../client/dockerfile
[APP] [REMOTE]  < ~/projects/.../client/dockerfile
/home/.../sicksync/dist/remote/fs-helper.js:67../client/dockerfile
            _fsExtra2['default']['delete']((0, _untildify2['default'])(message.destinationpath), function (err) {
                                        ^

TypeError: _fsExtra2.default.delete is not a function
    at FSHelper.removePath (/home/.../sicksync/dist/remote/fs-helper.js:67:43)
    at WSServer.<anonymous> (/home/.../sicksync/dist/remote/index.js:72:26)
    at emitOne (events.js:96:13)
    at WSServer.emit (events.js:188:7)
    at WSServer.handleMessage (/home/.../sicksync/dist/remote/ws-server.js:69:29)
    at emitTwo (events.js:106:13)
    at WebSocket.emit (events.js:191:7)
    at Receiver.ontext (/home/.../sicksync/node_modules/ws/lib/WebSocket.js:816:10)
    at /home/.../sicksync/node_modules/ws/lib/Receiver.js:477:18
    at /home/.../sicksync/node_modules/ws/lib/Receiver.js:361:7

Here the file is npm-debug.log.1806592492 which I gets created momentarily and then automatically deleted.

change client\npm-debug.log.1806592492
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                ^

Error: ENOENT: no such file or directory, open 'C:\...\client\npm-debug.log.1806592492'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at FSHelper.onFileChange (C:/.../sicksync/src/local/fs-helper.js:51:66)
    at Timeout._onTimeout (C:/.../sicksync/src/util.js:104:23)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)

Don't know if this is a windows only issue. Does it cause issues on *nix?

joelgriffith commented 7 years ago

This may well be a bug in fs-extra, I'll have to investigate this

joelgriffith commented 7 years ago

Fixed in 3.0.0