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 support for defining file size limit per attachment type #3105

Merged
merged 9 commits into from Mar 25, 2024

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Mar 20, 2024

🔗 Issue Links

Resolves https://github.com/GetStream/ios-issues-tracking/issues/757

🎯 Goal

Add support for defining a file size limit per type through Stream's Dashboard App Settings.

📝 Summary

  • Expose sizeLimitInBytes in ChatClient.appSettings.fileUploadConfig and ChatClient.appSettings.imageUploadConfig
  • Composer checks the file size limit per type if defined through Stream's Dashboard
  • Deprecates ChatClientConfig.maxAttachmentSize

🧪 Manual Testing Notes

NOTE: At the moment, changing the value in the dashboard is still not supported, so to test this it is required to override the values from Proxyman or by using the Stream's CLI API.

Scenario 1 - Value not set in the Dashboard

  1. Send an image and/or file with 200MB
  2. Should show error with the max attachment size limit reached

Scenario 2 - Set image limit in the dashboard

  1. Send an image above the limit defined
  2. Should show error with max attachment size limit reached

Scenario 3 - Set file limit in the dashboard

  1. Send a file or any other type besides an image above the limit defined
  2. Should show error with max attachment size limit reached

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

@nuno-vieira nuno-vieira added 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK ✅ Feature An issue or PR related to a feature labels Mar 20, 2024
@nuno-vieira nuno-vieira requested a review from a team as a code owner March 20, 2024 17:38
@nuno-vieira nuno-vieira force-pushed the add/size-limit-per-attachment-type branch from 64147b6 to 705f2d5 Compare March 20, 2024 17:44
@Stream-iOS-Bot
Copy link
Collaborator

StreamChat XCMetrics

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 8.35 ms 16.5% 🔼 🟢
Duration 2.6 s 2.54 s 2.31% 🔼 🟢
Hitch time ratio 4 ms per s 3.29 ms per s 17.75% 🔼 🟢
Frame rate 79 fps 78.12 fps 1.11% 🔼 🟢
Number of hitches 1 1.0 0.0% 🔽 🟢
ChannelList Hitches total duration 12.5 ms 9.18 ms 26.56% 🔼 🟢
Duration 2.6 s 2.55 s 1.92% 🔼 🟢
Hitch time ratio 5 ms per s 3.6 ms per s 28.0% 🔼 🟢
Frame rate 76 fps 74.71 fps 1.7% 🔼 🟢
Number of hitches 1.2 0.6 50.0% 🔼 🟢

@nuno-vieira nuno-vieira marked this pull request as draft March 21, 2024 15:41
@nuno-vieira
Copy link
Member Author

Converted to draft, to wait for the Dashboard implementation

@nuno-vieira nuno-vieira marked this pull request as ready for review March 22, 2024 15:42
Copy link

sonarcloud bot commented Mar 25, 2024

@nuno-vieira nuno-vieira merged commit 2ad5fcc into develop Mar 25, 2024
15 checks passed
@nuno-vieira nuno-vieira deleted the add/size-limit-per-attachment-type branch March 25, 2024 13:25
@laevandus laevandus mentioned this pull request Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Feature An issue or PR related to a feature 🌐 SDK: StreamChat (LLC) Tasks related to the StreamChat LLC SDK 🎨 SDK: StreamChatUI Tasks related to the StreamChatUI SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants