Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup renaming #950

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Backup renaming #950

merged 3 commits into from
Sep 22, 2023

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Sep 22, 2023

fix(backup): Change how we rename file when conflict
fix(backup): Use only name and creationDate to compare medias

Previous solution was not working for Android because we needed to know image format for every manufacturer.

We choose to use _conflict_<date> because it will be unique with the date, and we will be able to differentiate from Desktop conflict which use -conflict-<date>.
@zatteo zatteo changed the title Fix/renaming Backup renaming Sep 22, 2023
To avoid creating too much duplicate for next step about deduplication,
we will compare only by name and creationDate. modificationDate is too
much subject to change, and can't be trusted in some cases (shared iCloud
albums for example).
cozy-stack may not take into account ms from a date.
So we decided to ignore ms in our date.
But sometimes cozy-stack still add ms into server date.
So we need to remove ms when received a date from the server.
return (
file.name === media.name &&
new Date(file.created_at).getTime() === media.creationDate
file.name === media.name && creationDate.getTime() === media.creationDate
)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nono are you aware about the need to do that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was a message about a precision issue (with milliseconds in one case, and without in the other case)

@zatteo zatteo merged commit 3ea7a19 into master Sep 22, 2023
2 checks passed
@zatteo zatteo deleted the fix/renaming branch September 22, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants