googleapis / googleapis/google-api-nodejs-client

HTTP/2 option ignore timeout option

Open
#3,187 3 comments 0 reactions 1 assignee Claimed by @ddelgrosso1 View on GitHub
priority: p3 type: feature request
Dominant language
TypeScript
Stars
12.2k
Forks
2k
Avg merge
1d 9h
Merged PRs (30d)
24

Description

#### Environment details

- OS:
- Node.js version: 18.15.0
- npm version: 9.5.0
- `googleapis` version: 112.0.0

#### Steps to reproduce

1. set http2 and timeout options to google.options
```javascript
google.options({http2: true, timeout: 1})
```
2. send any request to google apis

```javascript
google.calendar().events.list({calendarId: ${calendarId}})
```

I expect api request fails.because it has very short timeout but i got response successfully unlike request through HTTP/1.1
I guess googleapi-common library does not fully support options. because I tested googleapi-common http2 module, the module ignored timeout config.

test code comparing http2 module to node-fetch module
```javascript
import { request } from 'googleapis-common/build/src/http2';
import nodefetch from 'node-fetch';

request({
timeout: 1,
url: 'https://www.google.com',
headers: { timeout: 1 },
}).then((r) => {
console.log(r);
});

nodefetch('https://www.google.com', { timeout: 1 }).catch(console.error);

```

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.