Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-175

Some remote changes aren't detected because of modification time rounded down ot the second



    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1107
    • Fix Version/s: 1.3.1216
    • Component/s: Model, Remote client
    • Sprint:
      Sprint Drive 7.1-2
    • Story Points:


      Detected in tests when calling sync loop at least 2 times in a row within 1 second.
      As remote last modification time is rounded down to the second, see RemoteFileSystemClient#file_to_info:

          milliseconds = fs_item['lastModificationDate']
          last_update = datetime.fromtimestamp(milliseconds // 1000)

      when updating remote state the change might not be detected if doc_pair.last_remote_updated is not different from remote_info.last_modification_time, see Model#update_remote:

      elif (remote_info.last_modification_time != self.last_remote_updated
          or self.remote_parent_ref != remote_info.parent_uid):
          # Remote update and/or rename and/or move or restore from the trash
          log.trace("Doc %s has been either modified, renamed, moved or"
                    " restored from the trash,"
                    " set last_remote_updated to %s",
                    self.remote_name, remote_info.last_modification_time)
          self.last_remote_updated = remote_info.last_modification_time
          modified = False
          # Only consider a remote folder for which the modification time
          # has changed as modified if its name or its parent has changed
          # (rename or move)
          if (self.folderish
              and (self.remote_name != remote_info.name
                   or self.remote_parent_ref != remote_info.parent_uid)):
              log.trace("Doc %s is a folder that has been renamed or moved,"
                        " set remote_state to 'modified'",
              modified = True
          # Only consider a remote file for which the modification time has
          # changed as modified in the following cases:
          # - its name has changed (rename)
          # - its parent has changed (move)
          # - its content has changed (content update)
          # - its digest is different from the local one (can happen if
          # restored from the trash and content has been locally updated)
          if (not self.folderish
              and (self.remote_name != remote_info.name
                   or self.remote_parent_ref != remote_info.parent_uid
                   or self.remote_digest != remote_info.get_digest()
                   or self.remote_digest != self.local_digest)):
              log.trace("Doc %s is a file that has been renamed, moved,"
                        " for which the content has been updated or restored"
                        " from the trash, set remote_state to 'modified'",
              modified = True
          if modified:
              remote_state = 'modified'


          Issue Links



              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: