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 file property to the ImageAttachmentPayload #3548

Merged
merged 5 commits into from
Jan 6, 2025

Conversation

laevandus
Copy link
Contributor

@laevandus laevandus commented Jan 3, 2025

🔗 Issue Links

Resolves IOS-319

🎯 Goal

Fix an issue where ImageAttachmentPayload does not set file_size and/or mime_type

📝 Summary

  • Add ImageAttachmentPayload.file and new init method requiring setting file
  • Deprecate init(title:imageRemoteURL:originalWidth:originalHeight:extraData:) in favour of init(title:imageRemoteURL:file:originalWidth:originalHeight:extraData:)
  • Aligns ImageAttachmentPayload to other attachment payloads which require file to be set

🛠 Implementation

Other attachment payloads require AttachmentFile type when creating a payload. ImageAttachmentPayload is the only one which represents a file, but does not require it. This leads to all the image attachments sent from the iOS SDK to not set file_size and/or mime_type.

🧪 Manual Testing Notes

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@laevandus laevandus added 🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK labels Jan 3, 2025
@laevandus laevandus requested a review from a team as a code owner January 3, 2025 09:15
@laevandus laevandus force-pushed the feature/image-attachment-file-size branch from 532fb66 to c82cee2 Compare January 3, 2025 09:19
@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Jan 3, 2025

SDK Size

title develop branch diff status
StreamChat 7.03 MB 7.05 MB +17 KB 🟢
StreamChatUI 4.77 MB 4.77 MB 0 KB 🟢

@Stream-SDK-Bot
Copy link
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 8.34 ms 16.6% 🔼 🟢
Duration 2.6 s 2.56 s 1.54% 🔼 🟢
Hitch time ratio 4 ms per s 3.26 ms per s 18.5% 🔼 🟢
Frame rate 75 fps 78.43 fps 4.57% 🔼 🟢
Number of hitches 1 0.6 40.0% 🔼 🟢

@Stream-SDK-Bot
Copy link
Collaborator

Stream-SDK-Bot commented Jan 3, 2025

SDK Size

title develop branch diff status
StreamChat 6.98 MB 6.98 MB +1 KB 🟢
StreamChatUI 4.77 MB 4.77 MB 0 KB 🟢

Copy link
Member

@nuno-vieira nuno-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅

@laevandus laevandus merged commit 66719bb into develop Jan 6, 2025
13 of 14 checks passed
@laevandus laevandus deleted the feature/image-attachment-file-size branch January 6, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug An issue or PR related to a bug 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants