From e0f240663f74f1bec60fb96db0f2b216a39795bd Mon Sep 17 00:00:00 2001 From: William Stein Date: Sat, 21 Oct 2023 21:31:38 +0000 Subject: [PATCH] fix bug in caching that caused tar to say fils were changed as we read - actual bug was that we forgot to cache the ctime (=mtime) --- websocketfs/lib/sftp-fuse.ts | 5 +++-- websocketfs/package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/websocketfs/lib/sftp-fuse.ts b/websocketfs/lib/sftp-fuse.ts index 185a19c..5eb3771 100644 --- a/websocketfs/lib/sftp-fuse.ts +++ b/websocketfs/lib/sftp-fuse.ts @@ -375,8 +375,9 @@ export default class SftpFuse { for (const { filename, stats, longname } of items) { try { stats.blocks = parseInt(longname.split(" ")[0]); - } catch (_) {} - this.attrCache.set(join(path, filename), { attr: stats }); + } catch (err) {} + const attr = { ...stats, ctime: stats.mtime }; + this.attrCache.set(join(path, filename), { attr }); } } this.dirCache?.set(path, filenames); diff --git a/websocketfs/package.json b/websocketfs/package.json index 6a779a2..7e7d9ec 100644 --- a/websocketfs/package.json +++ b/websocketfs/package.json @@ -1,6 +1,6 @@ { "name": "websocketfs", - "version": "0.10.1", + "version": "0.10.2", "description": "Like sshfs, but over a WebSocket", "main": "./dist/lib/index.js", "scripts": {