Open teto opened 2 years ago
Yeah, I'm guessing it's because massive tag changes like that result in massive requests. To solve this, we should add a new config option to optionally hard-cap the number of messages to update in a request for flaky servers or connections.
It passed for the first time now:
➜ mujmap sync
Retrieving metadata... (9945 possibly changed)
Downloading new mail...
█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 11/11
Applying changes to notmuch database... (11 new, 9945 changed, 0 destroyed)
Applying changes to JMAP server... (10419 changed)
~/maildir/fastmail took 25s
➜ mujmap sync
Retrieving metadata... (10420 possibly changed)
Applying changes to notmuch database... (0 new, 10420 changed, 0 destroyed)
Applying changes to JMAP server... (509 changed)
The funny thing is that the server times out instantaneously, it's not like it tries to process my request, the timeout on fastmail side must be low. I dont know if this should be configurable (at least userfacing) but the ability to split a big request into several small ones would be nice. Maybe even the server could return a hint about the size of the request.
The server does return a hint about the request size, and we do respect it, but it doesn't seem like it can be fully trusted given the behavior you're encountering 😔
Also running into this problem, while trying to sync 14k changes do to changing a tag.
Not the most elegant of solutions, but as a band-aid, this worked for me.
diff --git a/src/remote.rs b/src/remote.rs
index 7829255..74abac1 100644
--- a/src/remote.rs
+++ b/src/remote.rs
@@ -994,7 +994,7 @@ impl Remote {
// Send it off into cyberspace~
const SET_METHOD_ID: &str = "0";
- let chunk_size = self.session.capabilities.core.max_objects_in_set as usize;
+ let chunk_size = 50 as usize;
for chunk in &updates.into_iter().chunks(chunk_size) {
let account_id = &self.session.primary_accounts.mail;
Same issue here, does not work well on massive changes.
My initial sync worked well, I now tried to change tags and reran mujmap sync and I hit:
Error encountered in the status line: timed out reading response
I wonder if its due to the size of the request, I've got sthg like 11000mails and I get in the log a seemingly long request with lines ofThis is the end of the log
the funny thing is that the tag I changed was successfully sent to fastmail as I can now see it in the UI, which is fantastic , it means mujmap has been solving my single biggest issue in my setup so thanks for that. Let me know how I can help (testing etc)