cozy-labs / cozy-desktop

File Synchronisation for Cozy on Desktop and Laptop
https://cozy-labs.github.io/cozy-desktop/
GNU Affero General Public License v3.0
99 stars 45 forks source link

core/remote: Use most recent remote date #2208

Closed taratatach closed 2 years ago

taratatach commented 2 years ago

In some cases, at least when importing images from a mobile device via Drive Mobile's synchronization, we can have files with a creation date (created_at field) that is more recent than the latest modification date (updated_at field).

This should be impossible since cozy-stack forbids these situations but we do see them in production. As a consequence, further metadata updates on the file, such as a move, will be rejected by cozy-stack due to the "invalid modification date".

Since the user cannot fix this problem easily, we don't want to stop the Desktop synchronization when we encounter such files. This is why we'll use for the updated_at field value, in every request sent to cozy-stack, the most recent date between the following:

Please make sure the following boxes are checked: