mirror of
https://github.com/mjl-/mox.git
synced 2025-07-13 06:14:38 +03:00
imapserver: Don't keep account write-locked during IMAP FETCH command
We effectively held the account write-locked by using a writable transaction while processing the FETCH command. We did this because we may have to update \Seen flags, for non-PEEK attribute fetches. This meant other FETCHes would block, and other write access to the account too. We now read the messages in a read-only transaction. We gather messages that need marking as \Seen, and make that change in one (much shorter) database transaction at the end of the FETCH command. In practice, it doesn't seem too sensible to mark messages as seen automatically. Most clients probably use the PEEK-variant of attribute fetches. Related to issue #128.
This commit is contained in:
@ -3565,9 +3565,7 @@ func (c *conn) cmdAppend(tag, cmd string, p *parser) {
|
||||
committed = true
|
||||
|
||||
// Fetch pending changes, possibly with new UIDs, so we can apply them before adding our own new UID.
|
||||
if c.comm != nil {
|
||||
pendingChanges = c.comm.Get()
|
||||
}
|
||||
pendingChanges = c.comm.Get()
|
||||
|
||||
// Broadcast the change to other connections.
|
||||
for _, a := range appends {
|
||||
|
Reference in New Issue
Block a user