feat: Deduplicate blob files in the JsonRPC API#6470
Merged
Conversation
2 tasks
0d5c3ad to
7663144
Compare
Hocuri
commented
Jan 24, 2025
| // mimics the old desktop call, will get replaced with something better in the composer rewrite, | ||
| // the better version will just be sending the current draft, though there will be probably something similar with more options to this for the corner cases like setting a marker on the map | ||
| #[allow(clippy::too_many_arguments)] | ||
| async fn misc_send_msg( |
Collaborator
Author
There was a problem hiding this comment.
Not sure whether it's necessary to change this function and misc_set_draft() since it's going to be replaced anyway?
Is this function and misc_set_draft() still in use in the Desktop UI?
Collaborator
There was a problem hiding this comment.
Currently it is still used, did a quick grep for miscSetDraft.
link2xt
reviewed
Jan 24, 2025
link2xt
reviewed
Jan 24, 2025
link2xt
approved these changes
Jan 24, 2025
14 tasks
Septias
approved these changes
Jan 31, 2025
Co-authored-by: l <link2xt@testrun.org>
7d67188 to
ba20946
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes it so that files will be deduplicated when using the JsonRPC API.
@nicodh and @WofWca you know the Desktop code and how it is using the API, so, you can probably tell me whether this is a good way of changing the JsonRPC code - feel free to push changes directly to this PR here!
This PR here changes the existing functions instead of creating new ones; we can alternatively create new ones if it allows for a smoother transition.
This brings a few changes:
<hash>.<extension>immediately (previously, the filename on the disk stayed the same)create_message(), it's better to directly create it in the blobdir, since it doesn't need to be copied.set_file_and_deduplicate()that replaces the file on an existing message.In order to test whether everything still works, the desktop issue has a list of things to test: deltachat/deltachat-desktop#4498
Core issue: #6265