googleapis / googleapis/google-api-nodejs-client

GMail users.messages.list ignores labels when sent as an array

Open
#2,966 0 comments 0 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: mac
- Node.js version: v14.17.0
- npm version: 6.14.13
- `googleapis` version: ^100.0.0

#### Steps to reproduce
```ts
const optionsA = {
userId: 'me',
}

const optionsB = {
userId: 'me',
labelIds: ['SENT']
}

const optionsC = {
userId: 'me',
labelIds: 'SENT'
}

gmailClient.users.messages.list(optionsA); // --> returns messages
gmailClient.users.messages.list(optionsB); // --> returns the same messages as optionsA
gmailClient.users.messages.list(optionsC); // --> returns messages with the label 'SENT'
```
The params for list state that labelIds is an array:
```ts
export interface Params$Resource$Users$Messages$List extends StandardParameters {
/**
* Only return messages with labels that match all of the specified label IDs.
*/
labelIds?: string[];
}
```

Not sure if this is a documentation + TS Definition issue or something deeper

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.