diff --git a/src/routes/hooks/poll-imap.ts b/src/routes/hooks/poll-imap.ts index 664a95d..e68788f 100644 --- a/src/routes/hooks/poll-imap.ts +++ b/src/routes/hooks/poll-imap.ts @@ -58,13 +58,13 @@ export const Route = createFileRoute("/hooks/poll-imap")({ // First pass: collect just UIDs via search (no FETCH stream). // This avoids any large per-message data crossing the socket // before we know which messages to skip. - const uidList = await client.search( + const uidList = (await (client as any).search( { uid: range }, { uid: true }, - ); + )) as number[] | undefined; const candidateUids = (uidList ?? []) - .filter((u) => u > (settings.last_uid ?? 0)) - .sort((a, b) => a - b) + .filter((u: number) => u > (settings.last_uid ?? 0)) + .sort((a: number, b: number) => a - b) .slice(0, MAX_MESSAGES_PER_RUN * 4); for (const uid of candidateUids) {