@bobfrankston/iflow 1.0.56 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -293,7 +293,8 @@ export class NativeImapClient {
293
293
  const uids = await this.search(`UID ${sinceUid + 1}:*`);
294
294
  if (uids.length === 0)
295
295
  return [];
296
- console.log(` [fetch] ${uids.length} UIDs since ${sinceUid}`);
296
+ uids.reverse(); // Newest first
297
+ console.log(` [fetch] ${uids.length} UIDs since ${sinceUid} (newest first)`);
297
298
  if (uids.length <= NativeImapClient.INITIAL_CHUNK_SIZE) {
298
299
  const msgs = await this.fetchMessages(uids.join(","), options);
299
300
  if (onChunk)
@@ -323,7 +324,9 @@ export class NativeImapClient {
323
324
  const uids = await this.search(criteria);
324
325
  if (uids.length === 0)
325
326
  return [];
326
- console.log(` [fetch] ${uids.length} UIDs to fetch`);
327
+ // Reverse so newest messages (highest UIDs) come first
328
+ uids.reverse();
329
+ console.log(` [fetch] ${uids.length} UIDs to fetch (newest first)`);
327
330
  const allMessages = [];
328
331
  let chunkSize = NativeImapClient.INITIAL_CHUNK_SIZE;
329
332
  for (let i = 0; i < uids.length; i += chunkSize) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
4
4
  "description": "IMAP client wrapper library",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",