-
Notifications
You must be signed in to change notification settings - Fork 139
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
Clarify model for Event with attachment #3574
base: develop
Are you sure you want to change the base?
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
5ea9bde
to
8668f72
Compare
8668f72
to
2de51bc
Compare
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.
I think this is the opposite, from reading the spec?
body | string | Required: If filename is not set or the value of both properties are identical, this is the filename of the original upload. Otherwise, this is a caption for the image.Changed in v1.10: This property can act as a caption for the image.
filename | string | The original filename of the uploaded file.Added in v1.10
The filename is mandatory but the body is not ^
We are just mapping what the SDK is providing to the application here. There is maybe a problem in the SDK then? |
Mmm AFAICT, the SDK returns a non-nullable body and a nullable filename? |
Yes, I have read it too fast, my bad The mapping I have done in the EventContentMapper is still correct to me, and the application needs a non-nullable filename. So we always have a |
I think we should keep the mapping as they come from sdk, otherwise it brings confusion. |
OK, let's wait for the SDK to change, I think this is discussed in #2570. |
Heads up that this is now available in the SDK: matrix-org/matrix-rust-sdk#4081
|
fd750f0
to
6ea11fa
Compare
Quality Gate passedIssues Measures |
@ganfra PR updated with what is provided in matrix-org/matrix-rust-sdk#4081 |
Content
Clarify model for Event with attachment. They must have a
filename: String
and they may have abody :String?
(caption).If filename is missing from the SDK model, the body is used instead and in this case the body is not mapped to our model.
Motivation and context
Cleanup following change in #3567
The changes here should reduce the risk of errors.
Screenshots / GIFs
Tests
Tested devices
Checklist