Repository navigation
bisync: normalize session name to non-canonical (and docs edits) - fixes #7423 - #7497
Conversation
ncw
left a comment
There was a problem hiding this comment.
The point of those {suffix} is a reminder that with different backend flags the contents of the remote may be different.
They were put in for the VFS caching to make sure we don't mix up data we shouldn't.
For example if you override the --drive-root-folder-id you'll get a different set of files. However a lot of the flags, eg --drive-list-chunk will not affect the files shown.
So by ignoring the {...} you are removing a safety check - we should be encouraging the users to put the config overrides into the config file so they remain static.
I see that bisync has exactly the same problem though with not being able to find previous listings.
Maybe we should merge your fix just with a warning to the user about getting the config overrides into the config file to make a static listing.
Happy to go with your decision here, so I shall approve this :-)
|
Thanks! Very good points. I think the safety check would be more properly addressed for Bisync by #5678 Sessions -- i.e. the ability for Bisync to detect that important flags have changed (whether backend or not) and require some extra confirmation like
Bisync users trip over this one quite a bit, so I think for the moment the unintended consequences outweigh the intended ones, and this feature should be merged, to be followed shortly by a better safety check via #5678. As an aside: part of the reason I started working on a draft of #2697 (comment) (Profiles) is because I am considering this as a possible way to implement #5678, as ivandeex also alluded to on that ticket. Basically -- use the Profiles methods to store a Bisync session in the config, and then on each run Bisync can detect if there are important differences. But it would also be possible to avoid storing this in the config, if the Profiles feature is too big to take on right now (for instance, Bisync could just marshall the flag configuration to JSON and store in the |
as these changes did not make it in time for 1.65
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.
0843f7b to
7b78acf
Compare
|
(rebased to clear out the duplicate commits) |
Hmm, yes! Though people don't usually use those with
Aye. There is no way to do this other than markup all the individual config items which I decided was too much work!
That sounds fine to me. I prefer the evolution towards perfection, than the striving for perfection immediately approach!
OK! I'm catching up on the PRs so will get to it soon :-) |
(This PR is dependent on #7410 -- only 3 of the commits are new 🙂 )
What is the purpose of this change?
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.
Was the change discussed in an issue or in the forum before?
Checklist