underworldcode/cloudstor

Shared folders return size None leading to issue in compare

srggrs opened this issue · 4 comments

When I compare a shared folder, the returned size from info method is None, see this line in the code base

This is not the world's most robust code, so it does not surprise me that it produces some surprises.

Is the problem that it flags false for remote == local as a result of this casual coding, or is does it throw an error ?

The problem is that it compares None (size from remote) with a float/integer (size from local) at this line. The comparison gives an error because the two sizes are of different type

OK - I guess there is an inconsistency in the return value for folders depending on whether they are remote or local. We can be more strict here to reject folder comparisons since there is not an obvious way to check a whole folder without some capacity for a checksum.

I think the only option is list folders and subfolders for both remote and local and make a diff, if files exist in both, check the file size