-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix connector updates for create message. There was a bug in them related to messages with the same ID.
- Loading branch information
1 parent
449783e
commit ec2d0e4
Showing
4 changed files
with
92 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package tests | ||
|
||
import ( | ||
"github.com/ProtonMail/gluon/imap" | ||
"github.com/ProtonMail/gluon/internal/utils" | ||
"testing" | ||
) | ||
|
||
|
@@ -269,3 +271,22 @@ func TestMessageFlaggedUpdate(t *testing.T) { | |
c.OK("A004") | ||
}) | ||
} | ||
|
||
func TestMessageAddWithSameID(t *testing.T) { | ||
runOneToOneTestWithAuth(t, defaultServerOptions(t), func(c *testConnection, s *testSession) { | ||
mailboxID := s.mailboxCreated("user", []string{"mbox"}) | ||
flags := []string{imap.FlagFlagged, imap.FlagDraft, "\\foo", "\\bar", imap.AttrMarked} | ||
messageID := imap.MessageID(utils.NewRandomMessageID()) | ||
s.batchMessageCreatedWithID("user", mailboxID, 2, func(i int) (imap.MessageID, []byte, []string) { | ||
return messageID, []byte("to: [email protected]"), flags | ||
}) | ||
|
||
s.flush("user") | ||
|
||
c.C("A001 SELECT mbox").OK("A001") | ||
|
||
c.C("A003 FETCH 1 (FLAGS)") | ||
c.S(`* 1 FETCH (FLAGS (\Draft \Flagged \Marked \Recent \bar \foo)`) | ||
c.OK("A003") | ||
}) | ||
} |