Context
PR #415 switched the Android WebView file chooser from ACTION_GET_CONTENT to ACTION_OPEN_DOCUMENT to work around a Chromium bug where proxy URIs returned by the Android 13+ Photo Picker report inconsistent last_modified metadata, triggering ERR_UPLOAD_FILE_CHANGED validation failures.
Chromium bug: https://issues.chromium.org/issues/40123366
Details
- On Android 13+,
ACTION_GET_CONTENT for image/video MIME types is intercepted by the system Photo Picker, which returns content://media/picker/... proxy URIs.
- These proxy URIs report different
last_modified values between queries, which Chromium's WebView treats as the file having changed mid-upload.
- The error only occurs in Android WebView, not in Chrome browser directly.
ACTION_OPEN_DOCUMENT bypasses the Photo Picker and routes to DocumentsUI, which returns stable content://com.android.providers.media.documents/... URIs that don't trigger the bug.
Why track this
ACTION_OPEN_DOCUMENT works but presents a different file picker UI (DocumentsUI instead of the Photo Picker). If/when the Chromium bug is resolved, we should evaluate switching back to ACTION_GET_CONTENT to give users the more modern Photo Picker experience.
References
Context
PR #415 switched the Android WebView file chooser from
ACTION_GET_CONTENTtoACTION_OPEN_DOCUMENTto work around a Chromium bug where proxy URIs returned by the Android 13+ Photo Picker report inconsistentlast_modifiedmetadata, triggeringERR_UPLOAD_FILE_CHANGEDvalidation failures.Chromium bug: https://issues.chromium.org/issues/40123366
Details
ACTION_GET_CONTENTfor image/video MIME types is intercepted by the system Photo Picker, which returnscontent://media/picker/...proxy URIs.last_modifiedvalues between queries, which Chromium's WebView treats as the file having changed mid-upload.ACTION_OPEN_DOCUMENTbypasses the Photo Picker and routes to DocumentsUI, which returns stablecontent://com.android.providers.media.documents/...URIs that don't trigger the bug.Why track this
ACTION_OPEN_DOCUMENTworks but presents a different file picker UI (DocumentsUI instead of the Photo Picker). If/when the Chromium bug is resolved, we should evaluate switching back toACTION_GET_CONTENTto give users the more modern Photo Picker experience.References
ERR_UPLOAD_FILE_CHANGEerrors #224tus-js-clientdiscussion: Error on Chrome for Android when trying to upload file from Google Drive tus/tus-js-client#255 (comment)