From: Daira Hopwood Date: Sat, 30 Jan 2016 23:31:11 +0000 (+0000) Subject: Merge branch '2438.magic-folder-stable.9' of https://github.com/tahoe-lafs/tahoe... X-Git-Url: https://git.rkrishnan.org/%5B/frontends/flags/index.php?a=commitdiff_plain;h=42aadf5cade6b6ee12f6718ff37118a41be2c57a;p=tahoe-lafs%2Ftahoe-lafs.git Merge branch '2438.magic-folder-stable.9' of https://github.com/tahoe-lafs/tahoe-lafs into 2438.magic-folder-stable.10 Signed-off-by: Daira Hopwood --- 42aadf5cade6b6ee12f6718ff37118a41be2c57a diff --cc src/allmydata/frontends/magic_folder.py index 353b8fac,323e926f..bd226156 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@@ -612,9 -616,13 +616,13 @@@ class Downloader(QueueMixin, WriteFileM node = None for success, result in deferredList: if success: + if 'version' not in result[1]: + self._log("invalid remote metadata detected") + continue - else: - if result[1]['version'] > max_version: - node, metadata = result - max_version = result[1]['version'] ++ + if result[1]['version'] > max_version: + node, metadata = result + max_version = result[1]['version'] return node, metadata collective_dirmap_d.addCallback(highest_version) return collective_dirmap_d @@@ -629,10 -637,14 +637,15 @@@ file_node, metadata = listing_map[encoded_relpath_u] local_version = self._get_local_latest(relpath_u) - remote_version = metadata.get('version', None) ++ + if 'version' not in metadata: + self._log("invalid remote metadata detected for %r" % (relpath_u,)) + continue - else: - remote_version = metadata['version'] ++ ++ remote_version = metadata['version'] self._log("%r has local version %r, remote version %r" % (relpath_u, local_version, remote_version)) - if local_version is None or remote_version is None or local_version < remote_version: + if local_version is None or local_version < remote_version: self._log("%r added to download queue" % (relpath_u,)) if scan_batch.has_key(relpath_u): scan_batch[relpath_u] += [(file_node, metadata)] diff --cc src/allmydata/magicfolderdb.py index 982b5fe2,fdda3f06..1729e3f8 --- a/src/allmydata/magicfolderdb.py +++ b/src/allmydata/magicfolderdb.py @@@ -17,12 -17,12 +17,12 @@@ CREATE TABLE local_file path VARCHAR(1024) PRIMARY KEY, -- UTF-8 filename relative to local magic folder dir -- note that size is before mtime and ctime here, but after in function parameters size INTEGER, -- ST_SIZE, or NULL if the file has been deleted - mtime NUMBER, -- ST_MTIME - ctime NUMBER, -- ST_CTIME + mtime REAL, -- ST_MTIME + ctime REAL, -- ST_CTIME version INTEGER, -- last_uploaded_uri VARCHAR(256), -- URI:CHK:... -- last_downloaded_uri VARCHAR(256), -- URI:CHK:... - last_downloaded_timestamp TIMESTAMP ++ last_uploaded_uri VARCHAR(256), -- URI:CHK:... ++ last_downloaded_uri VARCHAR(256), -- URI:CHK:... + last_downloaded_timestamp REAL ); """