-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: bug not downloading correctly asset messages from web client #413
Conversation
This reverts commit aa2a0e2.
Did you consider ignoring asset messages which doesn't contain |
@typfel yes, that's what was being doine previously, and that caused that the asset messages appeared to be empty as those were the only ones including the asset metadata such as asset file name and size |
I mean we don't persist the message at all if the protobuf doesn't contain |
logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt
Outdated
Show resolved
Hide resolved
logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/ProtoContentMapper.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 and I would consider filtering out asset messages which only has the preview.
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
When Web client sends asset messages, it does it with 2 messages:
The way that the asset send and receive logic was implemented previously, was discarding any asset message that didn't include the file decryption keys. Therefore file metadata could not be displayed correctly if the original message didn't contain both.
Solutions
Even though in AR we send now just 1 asset message with all the needed info (metadata + decryption keys), to allow retrocompatibility with web clients that implement above behavior we had to make a workaround. This consists on storing the first preview message, and then updating it accordingly once the second message arrives with the final decryption keys
How to Test
A PR in AR will be raised following this one containing the fix.
Notes (Optional)
This solution is not optimal due to the fact that there is a lapse of time (between the 1st and 2nd messages being received) where the asset message received will not be able to be downloaded, as the
assetId
will be missing temporarily.PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.