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

Unable to create large (300+) number of tags at one time #51

Open
ocelotsloth opened this issue Jun 5, 2023 · 2 comments
Open

Unable to create large (300+) number of tags at one time #51

ocelotsloth opened this issue Jun 5, 2023 · 2 comments

Comments

@ocelotsloth
Copy link

ocelotsloth commented Jun 5, 2023

After running the following (it's ugly..I'm sure there's a better way but it worked) to create all the missing tags:

notmuch address --output=recipients --deduplicate=address --format=json to:@<my-domain> tag:inbox | jq -r '.[].address' | grep <my-domain> | xargs -L1 -I %s echo %s | cut -d@ -f1 | xargs -L1 -I %s notmuch tag -inbox +%s to:%s@<my-domain>

I am unable to synchronize those changes back up to Fastmail:

[ocelotsloth@ocelotsloth-xps mark]$ mujmap -v sync
Retrieving metadata... (7 possibly changed)
Applying changes to notmuch database... (0 new, 7 changed, 0 destroyed)
error: Could not sync mail: Could not create missing mailboxes for tags `[<<long list of 317 tag names>>]': Could not complete API request: https://api.fastmail.com/jmap/api/: status code 400

I'll take a closer look later today (after work), but my current guess is there's a limit to how many tags can be created in a single request and it may need to be paginated. I haven't dug into the mujmap code yet to see if it does that already though.

If I find it I'll try and get a patch written this week....I'd prefer that over manually adding all these tags in the web interface.

@vbmithr
Copy link

vbmithr commented Aug 6, 2023

Same issue here, with not so long a list (~50 elts).

@TimQuelch
Copy link

I ran into this issue as well. There is pagination implemented using the session's configured max_objects_in_set value https://github.com/elizagamedev/mujmap//blob/5f700af890769185ad99d4aae9f53496bb2aa6f2/src/remote.rs#L997

For fastmail this looks like it is 4096. I manually reduced it to 512 and that seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants