Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
|
||
| await expect(launchCallImagePicker()).resolves.toBe(pickerResult); | ||
| expect(mockLaunchImageLibraryAsync).toHaveBeenCalledWith({ | ||
| mediaTypes: ['images'], |
There was a problem hiding this comment.
Raw string literal used for the media type risks drift from the implementation and obscures intent. Use the shared MediaType constant/enum from the picker module or Expo API, such as mediaTypes: [MediaType.Images].
Kody rule violation: Use enums instead of magic strings
Prompt for LLM
File src/components/calls/__tests__/call-image-picker.test.ts:
Line 21:
Raw string literal used for the media type risks drift from the implementation and obscures intent. Use the shared `MediaType` constant/enum from the picker module or Expo API, such as `mediaTypes: [MediaType.Images]`.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| expect(mockLaunchImageLibraryAsync).toHaveBeenCalledWith({ | ||
| mediaTypes: ['images'], | ||
| allowsEditing: true, | ||
| quality: 0.8, |
There was a problem hiding this comment.
Inlined magic number for the quality value risks inconsistency between the test and implementation, also occurring in src/components/calls/call-image-picker.ts:7-7. Import and reuse the named constant from launchCallImagePicker, such as quality: CALL_IMAGE_PICKER_QUALITY.
Kody rule violation: Replace magic numbers with named constants
Prompt for LLM
File src/components/calls/__tests__/call-image-picker.test.ts:
Line 23:
Inlined magic number for the quality value risks inconsistency between the test and implementation, also occurring in `src/components/calls/call-image-picker.ts:7-7`. Import and reuse the named constant from `launchCallImagePicker`, such as `quality: CALL_IMAGE_PICKER_QUALITY`.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
| @@ -0,0 +1,9 @@ | |||
| import * as ImagePicker from 'expo-image-picker'; | |||
|
|
|||
| export const launchCallImagePicker = (): Promise<ImagePicker.ImagePickerResult> => | |||
There was a problem hiding this comment.
Missing JSDoc documentation for the Promise-returning function obscures the resolve value shape, rejection conditions, and await requirement. Add a JSDoc block specifying @returns {Promise<ImagePicker.ImagePickerResult>} and detailing rejection conditions like permission denial or user cancellation.
Kody rule violation: Document async/Promise behavior and errors
Prompt for LLM
File src/components/calls/call-image-picker.ts:
Line 3:
Missing JSDoc documentation for the Promise-returning function obscures the resolve value shape, rejection conditions, and await requirement. Add a JSDoc block specifying `@returns {Promise<ImagePicker.ImagePickerResult>}` and detailing rejection conditions like permission denial or user cancellation.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Pull Request Description
RIC-T40 Permissions fix
This PR eliminates the need for broad Android media and storage permissions by switching call image selection to use the Android system Photo Picker.
Changes
Removed media library permission requests - The
CallImagesModalcomponent no longer callsrequestMediaLibraryPermissionsAsync(), removing the runtime permission prompt for media library access.Adopted non-legacy system Photo Picker - Introduced a dedicated
call-image-pickermodule that launches the image picker withlegacy: false, ensuring the modern Android system Photo Picker is used instead of any legacy fallback.Blocked broad media permissions at the manifest level - Added
blockedPermissionsto the Expo Android config to explicitly prevent transitive native dependencies from injecting broad media/storage permissions (READ_MEDIA_IMAGES,READ_MEDIA_VIDEO,READ_MEDIA_VISUAL_USER_SELECTED,READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE) during manifest merging.Added test coverage - New tests verify that broad media permissions remain blocked in the config and that the image picker correctly uses the non-legacy system picker without requesting broad media access.
Impact
This improves user privacy and aligns with modern Android best practices. Users selecting call images will no longer be prompted to grant access to their entire media library; instead, they interact directly with the system Photo Picker, which provides scoped, session-level access only to the selected image.