@bobfrankston/mailx-sync 0.1.24 → 0.1.26

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.
package/gmail.js CHANGED
@@ -287,11 +287,18 @@ export class GmailApiProvider {
287
287
  const references = referencesRaw.trim()
288
288
  ? referencesRaw.split(/\s+/).filter(r => r.startsWith("<") && r.endsWith(">"))
289
289
  : [];
290
+ // `date` = arrival time (Gmail internalDate) so it matches IMAP's
291
+ // INTERNALDATE semantics; `sentDate` = the Date: header (send time).
292
+ // The list defaults to sentDate so identical messages cluster and a
293
+ // received/sent toggle has a real received value (Bob 2026-07-01).
294
+ const internalMs = msg.internalDate ? new Date(Number(msg.internalDate)) : null;
295
+ const headerMs = dateRaw ? new Date(dateRaw) : null;
290
296
  return {
291
297
  uid: idToUid(msg.id),
292
298
  messageId,
293
299
  providerId: msg.id,
294
- date: dateRaw ? new Date(dateRaw) : (msg.internalDate ? new Date(Number(msg.internalDate)) : null),
300
+ date: internalMs ?? headerMs,
301
+ sentDate: headerMs ?? internalMs ?? undefined,
295
302
  subject,
296
303
  from: parseAddressList(fromRaw),
297
304
  to: parseAddressList(toRaw),
package/outlook.js CHANGED
@@ -316,6 +316,7 @@ export class OutlookApiProvider {
316
316
  messageId: msg.internetMessageId || "",
317
317
  providerId: msg.id,
318
318
  date: msg.receivedDateTime ? new Date(msg.receivedDateTime) : null,
319
+ sentDate: msg.sentDateTime ? new Date(msg.sentDateTime) : undefined,
319
320
  subject: msg.subject || "",
320
321
  from, to, cc,
321
322
  // Threading headers aren't reliably returned on the list path
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx-sync",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Platform-agnostic mail provider implementations + sync orchestration. Single source of truth for Gmail/IMAP/Outlook protocol code, consumed by both desktop (Node) and Android (WebView) — eliminates the parallel mailx-imap/mailx-store-web Gmail providers that drifted in practice.",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",
@@ -19,7 +19,7 @@
19
19
  "author": "Bob Frankston",
20
20
  "license": "ISC",
21
21
  "dependencies": {
22
- "@bobfrankston/iflow-direct": "^0.1.55",
22
+ "@bobfrankston/iflow-direct": "^0.1.56",
23
23
  "@bobfrankston/tcp-transport": "^0.1.7"
24
24
  },
25
25
  "exports": {
@@ -44,7 +44,7 @@
44
44
  },
45
45
  ".transformedSnapshot": {
46
46
  "dependencies": {
47
- "@bobfrankston/iflow-direct": "^0.1.55",
47
+ "@bobfrankston/iflow-direct": "^0.1.56",
48
48
  "@bobfrankston/tcp-transport": "^0.1.7"
49
49
  }
50
50
  }
package/types.d.ts CHANGED
@@ -18,6 +18,7 @@ export interface ProviderMessage {
18
18
  messageId: string;
19
19
  providerId: string;
20
20
  date: Date | null;
21
+ sentDate?: Date;
21
22
  subject: string;
22
23
  from: {
23
24
  name?: string;