Skip to content

Fix Google Drive root browse returning an empty list - #22

Merged
jzongker merged 1 commit into
mainfrom
feature/944-google-drive-empty-browse
Aug 18, 2026
Merged

Fix Google Drive root browse returning an empty list#22
jzongker merged 1 commit into
mainfrom
feature/944-google-drive-empty-browse

Conversation

@jzongker

Copy link
Copy Markdown
Contributor

Browsing Google Drive returned nothing on production (ChurchAppsSupport #944).

Root cause

GoogleDriveProvider.listFiles sent includeItemsFromAllDrives=true alongside a 'root' in parents query. root is an alias that only resolves inside the user's own corpus, so pairing it with an all-drives search made Google reject the request. ApiHelper.apiRequest turned the non-OK response into null, listFiles broke out of its pagination loop with no entries, and browse returned [] — an empty folder rather than an error.

Changes

  • listFiles: keep supportsAllDrives=true, drop includeItemsFromAllDrives, and set corpora=user. Ordering (folder,name_natural) is unchanged.
  • ApiHelper.apiRequest: on a non-OK response, log the response body truncated to 500 chars so the provider's actual reason shows up in logs instead of just the status code.
  • Tests: assert the root browse sends supportsAllDrives=true + corpora=user and no includeItemsFromAllDrives, and that a failed fetch yields []. Existing audio/octet-stream coverage is untouched.

All 34 content-providers tests pass.

@jzongker
jzongker merged commit fb9920b into main Aug 18, 2026
1 check passed
@jzongker
jzongker deleted the feature/944-google-drive-empty-browse branch August 18, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant