Immediately fetch after EXISTS response
Currently, after the server sends an EXISTS response, we do all kinds of things before we fetch the newly-arrived message. This leads to increased answer times.
We should:
- [x] remove the remaining jobs
- [ ] move housekeeping to a separate loop
- [ ] call store_seen_flags_on_imap() after fetching (currently we are calling it before)
#3240 was a draft PR that would have achieved the same goal in a different manner (and would have introduced new complexity).
All the jobs have been removed, now they are explicitly called from inbox loop: #3457
I made a new PR which simply moves fetch directly after IDLE: https://github.com/deltachat/deltachat-core-rust/pull/4974 Unlike old PR, new PR moves fetch call rather than doing fetch twice per iteration.
When I tested it right now:
- At the end of
idle()and at the start offetch_new_messages(), log the current system time (with milliseconds) - Then, to make a measurement:
- Wait for at least 60s while not touching Delta Chat. This is important because e.g.
update_recent_quota()is debounced to once a minute. - Receive a message
- Calculate the difference in the timestamps in my head
- Wait for at least 60s while not touching Delta Chat. This is important because e.g.
the difference was up to around 70ms, on average around 30-50ms.
@hpk42, @link2xt and me concluded that this is not worth it right now because if you didn't receive a message for a minute then it doesn't matter if it arrives 50ms later. And when we fiddled around in the IMAP loop, we often introduced bugs - so it's just not worth the trouble right now.
I'll add it to project resurrection in case speed becomes a bigger priority in the future.