Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marking more than 1000 email as read fails #75

Open
jzuken opened this issue Apr 6, 2022 · 1 comment
Open

Marking more than 1000 email as read fails #75

jzuken opened this issue Apr 6, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jzuken
Copy link
Collaborator

jzuken commented Apr 6, 2022

Could you please implement marking more that a thousand emails as read?

I had 2067 unread emails with the target label and run the tool with the '-mark' argument, which resulted in the following message:

failed to batch-delete label UNREAD from 2067 messages: googleapi: Error 400: Number of ids cannot exceed 1000, invalidArgument

The full command in this case was go run main.go -l alerts -mark -html -refs -compact.

@bzz bzz added enhancement New feature or request help wanted Extra attention is needed bug Something isn't working labels Apr 15, 2022
@bzz bzz changed the title Marking more than 1000 email as read Marking more than 1000 email as read fails Apr 15, 2022
@bzz bzz removed the enhancement New feature or request label Apr 15, 2022
@bzz
Copy link
Owner

bzz commented Apr 15, 2022

Good catch! Indeed that is just not implemented yet.

This would be a simple change that requires batching msgIds by 1k instead of passing them all together in

func ModifyMsgsDelLabel(srv *gmail.Service, user string, messages []*gmail.Message, label string) {
var msgIds []string
for _, msg := range messages {
before calling BatchModify API.

@bzz bzz added enhancement New feature or request good first issue Good for newcomers and removed bug Something isn't working labels Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants