From 7e17e1b90d89eeda0afe83216601b3e5f37cb1b8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 2 Sep 2026 16:32:13 +0100 Subject: [PATCH] bisync: fix failed transfers of empty files being recorded as synced When bisync is interrupted with a graceful shutdown it keeps the files which transferred successfully in its listings and rolls the rest back. An operator precedence mistake in that check meant a transfer of an empty file (or one of unknown size) was kept even when it had failed, so bisync recorded it as synced when it had not been. --- cmd/bisync/listing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/bisync/listing.go b/cmd/bisync/listing.go index 181301ef4..282565ff6 100644 --- a/cmd/bisync/listing.go +++ b/cmd/bisync/listing.go @@ -675,7 +675,7 @@ func (b *bisyncRun) modifyListing(ctx context.Context, src fs.Fs, dst fs.Fs, res b.debugFn(tr.Name, func() { prettyprint(tr, tr.Name, fs.LogLevelInfo) }) - if tr.Error == nil && tr.Bytes > 0 || tr.Size <= 0 { + if tr.Error == nil && (tr.Bytes > 0 || tr.Size <= 0) { prettyprint(tr, "keeping: "+tr.Name, fs.LogLevelDebug) toKeep = append(toKeep, tr.Name) }