hack to delete uids
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Elizabeth Hunt 2024-12-15 01:10:24 -08:00
parent 2e450aea97
commit f8777a6adf
Signed by: simponic
GPG Key ID: 2909B9A7FF6213EE
2 changed files with 3 additions and 4 deletions

View File

@ -21,7 +21,7 @@ interface ImapClientI {
) => Promise<FetchMessageObject[]>;
connect: () => Promise<void>;
getMailboxLock: (mailbox: string) => Promise<MailboxLockObject>;
messageDelete: (uids: number[]) => Promise<boolean>;
messageDelete: (uids: number[], opts: any) => Promise<boolean>;
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),
),
),

View File

@ -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()),
)();