Refresh timer being disabled due to an error during mail/index update#2921
Refresh timer being disabled due to an error during mail/index update#2921bramadams wants to merge 2 commits into
Conversation
| (condition-case err | ||
| (mu4e-update-mail-and-index | ||
| mu4e-index-update-in-background) | ||
| (error (mu4e-warn "Error during mu4e automatic update: %s" err))))))))) |
There was a problem hiding this comment.
Don't quite understand this, wouldn't this raise another error if the condition-case catches one? I.e., I'd expect (error nil).
There was a problem hiding this comment.
That might even be better, or perhaps more explicitly an (error (message "[mu4e] error during automatic update: %s" (error-message-string err))).
The reason the current patch worked in my case, is that I tend to have debug-on-error set to true:
- Without the fix, any transient issue would be thrown up until
timer-event-handler, where thecondition-case-unless-debughandler would not fire for thiserror, which is the root of the problem. - With my suggested fix, the
errorbecomes auser-error, for whichdebug-on-erroris meaningless (see the documentation ofuser-errorin subr.el), hence the handler intimer-event-handlerdoes trigger. - With your suggestion no error would happen at all, which would be even better.
Wrapping the call in `condition-case' fixes this issue.
633c0d6 to
7fc8e4d
Compare
|
I replaced the |
|
I've been running emacs for a while without restarting, and somehow the email auto-update functionality stopped working again, even with the above patch. No configuration options were changed, yet somehow something is blocking the automatic update. Manual updating works, but does not re-trigger the auto-update. Any suggestions why auto-update might stop working? I did not find any obvious error messages. |
There's a value |
|
OK, just checked and its value currently is Perhaps this pull request should not just log a message (even though I did not find any trace of the message logged by the above patch) but also re-trigger a timer? Not sure what would be the best approach for that. |
|
In other words, is there a way for the following code from |
My first question would be how mu4e--update-timer could ever become nil without mu4e-quit. Perhaps you can check that, e.g. with M-x debug-on-variable-change? |
|
OK, thanks, will look into this and will get back once the issue triggers again. |
|
Seems like the issue has been resolved: |
At least once a week, the refresh timer used to automatically check for new emails somehow gets disturbed if an error happens during mail/index update. Since this happens silently, I would only find out hours later that my emails are not up-to-date.
Wrapping the call in `condition-case' better protects against this issue.