diff --git a/src/email.ts b/src/email.ts index f916022..f8916d4 100644 --- a/src/email.ts +++ b/src/email.ts @@ -21,7 +21,7 @@ interface ImapClientI { ) => Promise; connect: () => Promise; getMailboxLock: (mailbox: string) => Promise; - messageDelete: (uids: number[]) => Promise; + messageDelete: (uids: number[], opts: any) => Promise; close: () => void; } @@ -257,8 +257,7 @@ export const perform = ( // cleanup. TE.bind("deleted", ({ imap, uid, mailboxLock }) => TE.tryCatch( - // () => imap.messageDelete([uid], { uid: true }), - () => imap.messageDelete([uid]), + () => imap.messageDelete([uid], { uid: true }), ToErrorWithLock(mailboxLock), ), ), diff --git a/tst/email.spec.ts b/tst/email.spec.ts index 5f2aa90..7315816 100644 --- a/tst/email.spec.ts +++ b/tst/email.spec.ts @@ -146,7 +146,7 @@ test("cleans up sent messages from inbox", async () => { perform(emailJob, mockDependencies), TE.map(() => { expect(imap.messageDelete).toHaveBeenCalledTimes(1); - expect(imap.messageDelete).toHaveBeenCalledWith([1]); + expect(imap.messageDelete).toHaveBeenCalledWith([1], { uid: true }); }), TE.mapLeft(() => expect(false).toBeTruthy()), )();