fix: limit media size in tweet composer media uploads - [CU-869bga43d] - #240
Merged
Conversation
…g an alert with a console warning for denied permissions.
… `allowsEditing` from image picker configurations.
Exo1i
requested review from
AhmedSobhy01,
AmrSamy59,
LoayAhmed304 and
im-saif
as code owners
December 15, 2025 14:23
Member
Author
im-saif
previously approved these changes
Dec 15, 2025
…ed media library permission.
Unit Tests Coverage ReportCoverage after merging fix/limit-media-size into dev will be
Coverage Report for Changed Files
|
|||||||||||||||||||||||||||||||
im-saif
approved these changes
Dec 15, 2025
AhmedSobhy01
approved these changes
Dec 15, 2025
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 pull request introduces file size validation for media uploads in the
TweetComposercomponent, ensuring that images and videos do not exceed specified size limits (5MB for images, 10MB for videos). It also refines permission handling in theuseMediaLibraryhook to avoid unnecessary permission prompts and improve user experience. The test suite is updated to mock file system checks and reflect the new logic.Media upload validation and user feedback:
TweetComposer, displaying alerts if files are too large [1] [2] [3] [4].expo-file-system/legacyfor file size retrieval and a helper functioncheckFileSize[1] [2].Test updates:
expo-file-systemin tests to simulate file size checks.allowsEditingproperty from media picker calls [1] [2].Permission handling improvements:
useMediaLibraryto only request permissions when necessary and prevent repeated prompts, with clearer user feedback on denied permissions [1] [2] [3].