go-imap icon indicating copy to clipboard operation
go-imap copied to clipboard

Avoid creating unnecessary backend.Mailbox objects

Open foxcpp opened this issue 4 years ago • 2 comments

Ref https://github.com/emersion/go-imap/issues/337#issuecomment-594458545

foxcpp avatar Mar 04 '20 16:03 foxcpp

There are also unnecessary uses of GetMailbox:

  1. Move SetSubscribed to User interface and do not call GetMailbox just to subscribe a mailbox.
  2. Mailbox.Status might get moved to the User interface as well, it might have benefits for backends that use shared db for all mailboxes and work needed for GetMailbox is different from information needed for Mailbox.Status (seems to match go-imap-sql).
  3. Append might get moved as well, but I do not think it is necessary. Though, I think it is a good idea to avoid opening the mailbox second time if the currently selected mailbox is already the target one.

foxcpp avatar Mar 04 '20 17:03 foxcpp

Resolved by #374.

foxcpp avatar Aug 03 '20 17:08 foxcpp

Fixed in go-imap v2.

emersion avatar Apr 04 '23 14:04 emersion