feat(google-drive-picker): add selectFolders option to control folder selection#6385
Open
EnverUsta wants to merge 1 commit into
Open
feat(google-drive-picker): add selectFolders option to control folder selection#6385EnverUsta wants to merge 1 commit into
selectFolders option to control folder selection#6385EnverUsta wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: f4737e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…er selection in picker
EnverUsta
force-pushed
the
google-drive-picker-select-folders
branch
from
July 21, 2026 12:42
02e5292 to
f4737e2
Compare
pratikmdhr
approved these changes
Jul 21, 2026
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.
Summary
The Google Drive Picker enables folder selection unconditionally, but the plugin uses the narrow
drive.fileOAuth scope. Underdrive.file, an app can only access files the user explicitly picks, selecting a folder does not grant access to its contents. So when a user selects a folder, listing it returns only the files the app already had per-file access to (often none), and the selection appears to do nothing.Reading arbitrary folder contents would require a restricted scope (
drive.readonly/drive), which triggers Google's security assessment (CASA), something many integrators specifically use this picker to avoid.This PR makes folder selection opt-in:
selectFoldersoption (defaultfalse) to@uppy/google-drive-picker.setIncludeFolders(true)stays unconditional); only folder selection (setSelectFolderEnabled) is gated by the option.selectFolders: trueand a picked folder resolves to zero files, the user sees an ambiguity-aware warning — underdrive.file, "empty folder" and "no access to the folder's contents" are indistinguishable.drive.filescope unchanged.Behavior change
Folder selection previously defaulted on but couldn't work reliably under
drive.file. It now defaults off; setselectFolders: trueto re-enable it. Captured in the changeset (@uppy/google-drive-pickerminor,@uppy/corepatch).Testing
showDrivePicker(6 tests, all passing).yarn workspace @uppy/core typecheckand@uppy/google-drive-picker typecheckclean.