rclone/cmd/bisync
nielash 199d82969b bisync: normalize session name to non-canonical - fixes #7423
Before this change, bisync used the "canonical" Fs name in the filename for its
listing files, including any {hexstring} suffix. An unintended consequence of
this was that if a user added a backend-specific flag from the command line
(thus "overriding" the config), bisync would fail to find the listing files it
created during the prior run without this flag, due to the path now having a
{hexstring} suffix that wasn't there before (or vice versa, if the flag was
present when the session was established, and later removed.) This would
sometimes cause bisync to fail with a critical error (if no listing existed
with the alternate name), or worse -- it would sometimes cause bisync to use an
old, incorrect listing (if old listings with the alternate name DID still
exist, from before the user changed their flags.)

After this change, the issue is fixed by always normalizing the SessionName to
the non-canonical version (no {hexstring} suffix), regardless of the flags. To
avoid a breaking change, we first check if a suffixed listing exists. If so, we
rename it (and overwrite the non-suffixed version, if any.) If not, we carry on
with the non-suffixed version. (We should only find a suffixed version if
created prior to this commit.)

The result for the user is that the same pair of paths will always use the same
.lst filenames, with or without backend-specific flags.
2024-01-20 15:38:26 -05:00
..
bilib bisync: normalize session name to non-canonical - fixes #7423 2024-01-20 15:38:26 -05:00
testdata bisync: account for differences in backend features on integration tests - see #5679 2024-01-20 14:50:08 -05:00
bisync_test.go bisync: account for differences in backend features on integration tests - see #5679 2024-01-20 14:50:08 -05:00
checkfn.go bisync: account for differences in backend features on integration tests - see #5679 2024-01-20 14:50:08 -05:00
cmd.go bisync: support two --backup-dir paths on different remotes 2024-01-20 14:50:08 -05:00
deltas.go bisync: fallback to cryptcheck or --download when can't check hash 2024-01-20 14:50:08 -05:00
help.go bisync: support two --backup-dir paths on different remotes 2024-01-20 14:50:08 -05:00
LICENSE.cjnaz bisync: implementation #5164 2021-11-01 21:00:27 +03:00
listing.go bisync: fallback to cryptcheck or --download when can't check hash 2024-01-20 14:50:08 -05:00
log.go bisync: account for differences in backend features on integration tests - see #5679 2024-01-20 14:50:08 -05:00
march.go bisync: support files with unknown length, including Google Docs - fixes #5696 2024-01-20 14:50:08 -05:00
operations.go bisync: normalize session name to non-canonical - fixes #7423 2024-01-20 15:38:26 -05:00
queue.go bisync: support files with unknown length, including Google Docs - fixes #5696 2024-01-20 14:50:08 -05:00
rc.go bisync: support two --backup-dir paths on different remotes 2024-01-20 14:50:08 -05:00