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

Add idFromLibrary and creationDateFromLibrary in io.cozy.files metadata for backup #1016

Merged
merged 4 commits into from
Nov 17, 2023

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Nov 16, 2023

Add idFromLibrary and creationDateFromLibrary in io.cozy.files metadata for backup
=> these id and date will never be changed by the stack so we can trust them
=> it will solve issues where two identical pictures were not seen as identical by the backup because the date was changed by the stack

Also changes the way we send metadata

I will create a PR later for react-native-camera-roll

query string

Adding metadata when uploading a file was done by creating a metadata
object and passing the metadata object id during the file upload.

I switch to pass the metadata object directly in query string. I did
not do it like this before because it was considered as a deprecated
method. After discussion with the cozy-stack team, it is now only a
not recommended method. We just need to be careful with the size of
the metadata object.

In the backup feature, we are really interested by the metadata in
query string way because it can reduce a lot the number of request
sent to the server. Especially because we will in a next commit add
an id and a creationDate in the metadata object, so every metadata
object will be different and it will not be possible to reuse
metadata object id anymore.
We will be able to use these values to compare if two pictures are the same locally.
These values will not be changed by the stack, contrary to created_at value.
This date will never be changed. So it is much safer.
@zatteo zatteo requested a review from Crash-- November 16, 2023 14:14
@zatteo zatteo changed the title Use own local id and creation date in backup Add idFromLibrary and creationDateFromLibrary in io.cozy.files metadata for backup Nov 16, 2023
@zatteo zatteo merged commit b1d391a into master Nov 17, 2023
@zatteo zatteo deleted the feat/use-own-local-id-and-creation-date-in-backup branch November 17, 2023 13:39
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.

2 participants