Closed sentry-io[bot] closed 10 months ago
Sentry issue: WOOCOMMERCE-ANDROID-22
Sentry issue: WOOCOMMERCE-ANDROID-22
Sentry issue: WOOCOMMERCE-ANDROID-TC
@nbradbury Does this look like a permissions issue on the device causing a crash? Is it something we should worry about? I don't see any crashes coming from 4.8 but I'm not sure if that means it was fixed or not.
@astralbodies That does look like a permission issue. In the trace I see this:
SecurityException
Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri
content://com.android.providers.media.documents/document/image%3A41586 from pid=31494, uid=10157
requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
@nbradbury Can permissions be revoked later by the user or would that cause the app to not launch until the proper required permissions are allowed?
Can permissions be revoked later by the user or would that cause the app to not launch until the proper required permissions are allowed?
On older devices, the original permission dialog is shown again. On newer devices we detect whether the user has revoked a permission and ask whether they want to edit their permissions.
Here's a link to the Google source code that displays that error. Note that the MANAGE_DOCUMENTS
permission is only available to system-level apps, so that's nothing we need to do.
So, I think that source code is telling us that the media picker does have MANAGE_DOCUMENTS
permission, which means it's the system media picker. However, our app doesn't have permission to access that specific media URI, which results in the crash. The error message is telling us we should use ACTION_OPEN_DOCUMENT to access the image (right now we use ACTION_GET_CONTENT).
Also, the crash occurs in MediaUtils
, which is part of the utility library we share with WPAndroid. There is a related crash happening in WPAndroid, and here's the Sentry crash report.
Update: This page suggests using CATEGORY_OPENABLE
to restrict images to only those that can be opened by a content resolver. Looking at the WPAndroid crash, the problem happens in this line where we use a content resolver to read the image.
This may be a possible fix.
Still happening as of 5.2 so reopening.
I tried once again to do as the error message said and switch to ACTION_OPEN_DOCUMENT
, but that doesn't enable the user to choose from Google Photos, which is a pretty important feature.
Issue archived since it's not happening in the latest versions of the app.
Adding MTTR-exclusion
label to avoid this issue getting into MTTR metric for October.2023. The issue was closed as not reproducible, so it should not be included in the metric.
Sentry Issue: WOOCOMMERCE-ANDROID-22
As of July 13: Events: 144 Users affected: 26