googleapis / googleapis/google-api-nodejs-client

Trying to download large email (>5MB) throws when options http2: true

Open
#3,109 3 comments 4 reactions 0 assignees View on GitHub
priority: p2 type: bug
Dominant language
TypeScript
Stars
12.2k
Forks
2k
Avg merge
1d 9h
Merged PRs (30d)
24

Description

#### Environment details

- OS: Linux / Macos
- Node.js version: v18.10.0
- npm version: 8.19.2
- `googleapis` version: 105/109.0.1

#### Steps to reproduce

1. Get a large email from Google API with the options {http2: false}
2. The function returns the following error:

```
Could not download email 17d03869ffcd2de1 Error: unexpected end of file
at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
at Zlib.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -5,
code: 'Z_BUF_ERROR'
}

```

Making the same request using the [Try this API](https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get?apix_params=%7B%22userId%22%3A%22me%22%2C%22id%22%3A%2217d03869ffcd2de1%22%2C%22format%22%3A%22raw%22%7D)

Making the same request with the {http2: false} option works as well.

Possibly related with:
#3108

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.