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

Adapt to file deduplication #2524

Open
2 tasks
Hocuri opened this issue Jan 16, 2025 · 0 comments
Open
2 tasks

Adapt to file deduplication #2524

Hocuri opened this issue Jan 16, 2025 · 0 comments

Comments

@Hocuri
Copy link

Hocuri commented Jan 16, 2025

We want to deduplicate blob files by always setting the file name to be the hash of the file content. Core issue: deltachat/deltachat-core-rust#6265, core PR: deltachat/deltachat-core-rust#6332

To be done:

  • Make sure that the actual name of the file isn't shown to the user or used to determine the file type (via the extension), instead dc_msg_get_filename() (C-FFI) or MessageObject.file_name (JsonRPC) needs to be used, similar to the Android PR at fix: Use getFilename() instead of the actual filename on disk deltachat-android#3521.
    • Search for usages of dc_msg_get_file() (C-FFI) / MessageObject.file (JsonRPC), check where it's passed, and make sure that all it's never used to check the file extension, to pass it to an external application, or to show it to the user.
    • Look at places in the code where a filename is user-visible, like when viewing it in the UI or passing it to an external application (especially when sharing or opening it). Check where the filename comes from, and make sure that it comes from dc_msg_get_filename(), not from dc_msg_get_file().
    • Test that
    1. sharing to and from DC

    2. opening

    3. saving ("Export attachment")

    4. drafting and re-entering the chat

    5. opening the drafted file once more

    6. sending

      still works for a) Images b) Videos c) vCards (attached contacts) d) attached files e) webxdc's. Also that editing and previewing drafted images works, and that previewing drafted videos works. (I hope I didn't forget to test any combination)

Then iOS will be ready for using core with deltachat/deltachat-core-rust#6332 merged. Received files will be deduplicated then, but outgoing files not yet.

If all of this becomes too complicated, tell me, we can also change how files are deduplicated a bit.

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

No branches or pull requests

1 participant