google-apis-core 1.0 (Faraday): download_dest receives gzip-compressed bytes instead of decompressed content
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start by reproducing the issue with the provided google-apis-drive_v3 download_dest example, then inspect the google-apis-core 1.0.2 Faraday migration in PR #23524 and the download_dest path. Done means StringIO, Tempfile, and file-path downloads receive decompressed binary content rather than gzip bytes, while export_file remains working.
Written by the indexing model from the issue text.
Description
Environment details
- Ruby version: 3.3.9
- google-apis-core version: 1.0.2
- google-apis-drive_v3 version: 0.79.0
- faraday version: 2.13+
- OS: Linux (Docker, also reproduced on macOS)
Summary
After upgrading from google-apis-core 0.18.0 (httpclient) to 1.0.2 (faraday), binary file downloads via download_dest receive raw gzip-compressed bytes instead of the decompressed file content. The old httpclient backend handled this transparently via transparent_gzip_decompression.
Steps to reproduce
```ruby
require "google/apis/drive_v3"
require "stringio"
client = Google::Apis::DriveV3::DriveService.new
client.authorization = Google::Auth.get_application_default(["https://www.googleapis.com/auth/drive"])
Download a binary file (e.g., .xlsx) from Google Drive
io = client.get_file("SOME_FILE_ID", download_dest: StringIO.new)
io.rewind
bytes = io.string
puts bytes.encoding #=> UTF-8
puts bytes[0..3].unpack1('H*') #=> "1f8b0800" (gzip magic number)
Expected: "504b0304" (ZIP/XLSX magic number)
```
Expected behavior
download_dest should receive the decompressed file content — the actual XLSX/ZIP binary data with magic bytes PK\x03\x04 (504b0304).
This was the behavior with google-apis-core 0.18.0 using httpclient, which had transparent_gzip_decompression enabled by default.
Actual behavior
download_dest receives raw gzip-compressed bytes (magic bytes \x1F\x8B / 1f8b0800). The content is not decompressed before being written to the IO/file.
This breaks any downstream code that expects the actual file content (e.g., parsing XLSX files with rubyzip or roo):
Zip::Error: Zip end of central directory signature not found
Additional context
- Affects all
download_desttargets: StringIO, Tempfile (binmode), and file path strings all receive gzip-compressed content. - Does not affect
export_file: Text exports (CSV, etc.) viaexport_filework correctly. - The
transparent_gzip_decompressionoption was deprecated in the Faraday migration (PR #23524), but no equivalent decompression was added fordownload_dest. - Workaround: Pin
google-apis-coreto< 1.0to continue using the httpclient backend.
Versions
| Gem | Working | Broken |
|---|---|---|
google-apis-core |
0.18.0 (httpclient) | 1.0.2 (faraday) |
google-apis-drive_v3 |
0.66.0 | 0.79.0 |
Related: PR #23524 (httpclient → faraday migration)
- Dominant language
- Ruby
- Stars
- 2.9k
- Forks
- 888
- Avg merge
- 8m
- Merged PRs (30d)
- 241
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/google-api-ruby-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
googleapis/google-api-ruby-client#28001 · 5 reactions ·
-
googleapis/google-api-ruby-client#27757 · 1 assignee ·
-
googleapis/google-api-ruby-client#27758 · 1 assignee ·
-
googleapis/google-api-ruby-client#27759 · 1 assignee ·
-
api: storage type: feature request
Difficulty 3/5 1-2 days Newbie friendliness 55/100
googleapis/google-api-ruby-client#27339 ·
All issues in googleapis/google-api-ruby-client
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hanami/hanami-cli#449 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
resque/resque-scheduler#826 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100