Skip to content

Commit

Permalink
test: Ensure initial sync has finished before running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshoulahan committed Sep 2, 2022
1 parent 0410288 commit 6073aff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion connector/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,14 @@ func (conn *Dummy) MarkMessagesFlagged(ctx context.Context, messageIDs []imap.Me

func (conn *Dummy) Sync(ctx context.Context) error {
for _, mailbox := range conn.state.getLabels() {
conn.updateCh <- imap.NewMailboxCreated(mailbox)
update := imap.NewMailboxCreated(mailbox)
defer update.Wait()

conn.updateCh <- update
}

update := imap.NewMessagesCreated()
defer update.Wait()

for _, message := range conn.state.getMessages() {
if err := update.Add(message, conn.state.getLiteral(message.ID), conn.state.getLabelIDs(message.ID)...); err != nil {
Expand Down

0 comments on commit 6073aff

Please sign in to comment.