-
Notifications
You must be signed in to change notification settings - Fork 313
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
"Freeze" the view of sequence numbers on per-connection basis #318
Comments
I will experiment with this and see what else needs to be done. |
no longer relevant, see latest comment Started working on it. I think there is also a need to buffer lastest MailboxUpdate and send it in response to the next command. I am not sure if this is required by RFC 3501, but this matches Dovecot behavior and has a higher chance of being interoperable. @emersion, is API between go-imap and extensions covered by 1.0 stability? While not directly breaking anything, extensions that accept or return sequence numbers may (not sure, haven't looked into it yet) need to be aware of it and call corresponding functions (SeqForBackend and SeqForClient) on them. |
no longer relevant, see latest comment
Backward-compatible option is to keep current behavior (totally broken) default and enable updates buffering via Server flag. I would really like to avoid introducing sub-optimal design choices to maintain compatibility while also enabling important fixes. There are more options, such as having buffering enabled only if extensions are marked as "compatible". Note sure what to do here. |
No, the idea is flawed. There is a need to enforce invariant "no expunges should happen while commands are in progress". Only backend can properly enforce this. More specifically, SeqForBackend and storage access should be fused into a single serializable operation without EXPUNGE happening in the middle. I think updates dispatching should be moved into backend code, then made aware of connections and mailboxes state (see #260 comments). This will allow it to perform any translations on its own, using serialization mechanisms appropriate for used strorage. |
Closing this, I will open a separate issue with proposed Backend interface changes for go-imap v2. |
The backend does not have a consistent view of the per-connection information and I think in the end it is a good thing since it reduces the backend implementation complexity considerably (I think \Recent support is not worth the changes I proposed in #260). But the outcome is that backend cannot implement the updates buffering themselves so it needs to be done in go-imap.
Here is what I think needs to be done:
Commands that flush sequence numbers buffer:
Commands that discard sequence numbers buffer without sending updates to the client:
Was briefly discussed in #300. The current behavior is racy/unsafe and non-RFC conforming since RFC 3501 prohibits EXPUNGE responses to be sent as a response to the FETCH command but we send updates at any time.
Reference: https://tools.ietf.org/html/rfc2180
The text was updated successfully, but these errors were encountered: