Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
9fe7d78aca
commit
7b934cd828
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user