mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
Pause event loop while FETCHing to prevetn EXPUNGE
This commit is contained in:
@ -383,6 +383,12 @@ func (im *imapMailbox) ListMessages(isUID bool, seqSet *imap.SeqSet, items []ima
|
||||
im.panicHandler.HandlePanic()
|
||||
}()
|
||||
|
||||
// EXPUNGE cannot be sent during listing and can come only from
|
||||
// the event loop, so we prevent any server side update to avoid
|
||||
// the problem.
|
||||
im.storeUser.PauseEventLoop(true)
|
||||
defer im.storeUser.PauseEventLoop(false)
|
||||
|
||||
var markAsReadIDs []string
|
||||
markAsReadMutex := &sync.Mutex{}
|
||||
|
||||
|
||||
@ -41,6 +41,8 @@ type storeUserProvider interface {
|
||||
attachedPublicKey,
|
||||
attachedPublicKeyName string,
|
||||
parentID string) (*pmapi.Message, []*pmapi.Attachment, error)
|
||||
|
||||
PauseEventLoop(bool)
|
||||
}
|
||||
|
||||
type storeAddressProvider interface {
|
||||
|
||||
Reference in New Issue
Block a user