@bobfrankston/rmfmail 1.1.8 → 1.1.10

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.
@@ -4378,6 +4378,10 @@ function sanitizeHtml(html) {
4378
4378
  return `url("") /* blocked: ${url} */`;
4379
4379
  });
4380
4380
  clean = clean.replace(/<\/?form\b[^>]*>/gi, "");
4381
+ clean = clean.replace(/<input\b[^>]*\/?>/gi, "[blocked: form input]");
4382
+ clean = clean.replace(/<textarea\b[^>]*>[\s\S]*?<\/textarea>/gi, "[blocked: textarea]");
4383
+ clean = clean.replace(/<select\b[^>]*>[\s\S]*?<\/select>/gi, "[blocked: select]");
4384
+ clean = clean.replace(/<button\b[^>]*>([\s\S]*?)<\/button>/gi, "$1");
4381
4385
  clean = clean.replace(/<iframe\b[^>]*>[\s\S]*?<\/iframe>/gi, "");
4382
4386
  return { html: clean, hasRemoteContent };
4383
4387
  }
@@ -9501,7 +9505,15 @@ var AndroidSyncManager = class {
9501
9505
  return existing;
9502
9506
  }
9503
9507
  emitEvent({ type: "syncProgress", accountId, phase: "folders", progress: 0 });
9504
- const providerFolders = await provider.listFolders();
9508
+ console.log(`[sync] ${accountId}: listing folders from provider`);
9509
+ let providerFolders = [];
9510
+ try {
9511
+ providerFolders = await provider.listFolders();
9512
+ } catch (e) {
9513
+ console.error(`[sync] ${accountId}: listFolders threw: ${e?.message || e}`);
9514
+ throw e;
9515
+ }
9516
+ console.log(`[sync] ${accountId}: provider returned ${providerFolders.length} folders` + (providerFolders.length > 0 ? ` (sample: ${providerFolders.slice(0, 3).map((f) => f.path || f.name).join(", ")})` : ""));
9505
9517
  for (const folder of providerFolders) {
9506
9518
  const flags = folder.flags || [];
9507
9519
  if (flags.some((f) => f.toLowerCase() === "\\noselect")) continue;
@@ -9509,6 +9521,7 @@ var AndroidSyncManager = class {
9509
9521
  }
9510
9522
  emitEvent({ type: "syncProgress", accountId, phase: "folders", progress: 100 });
9511
9523
  const dbFolders = this.db.getFolders(accountId);
9524
+ console.log(`[sync] ${accountId}: ${dbFolders.length} folders in db, inbox=${dbFolders.some((f) => f.specialUse === "inbox") ? "yes" : "no"}`);
9512
9525
  emitEvent({ type: "folderCountsChanged", accountId, counts: {} });
9513
9526
  return dbFolders;
9514
9527
  }
@@ -9887,9 +9900,17 @@ var OAUTH_SCOPES = "https://mail.google.com/ https://www.googleapis.com/auth/con
9887
9900
  async function getCachedToken(email) {
9888
9901
  const key = `oauth-token-${email.replace(/[@.]/g, "_")}`;
9889
9902
  const raw = localStorage.getItem(key);
9890
- if (!raw) return null;
9903
+ if (!raw) {
9904
+ console.log(`[oauth] no cached token for ${email} (localStorage key=${key} missing \u2014 fresh consent will follow)`);
9905
+ return null;
9906
+ }
9891
9907
  try {
9892
- return JSON.parse(raw);
9908
+ const parsed = JSON.parse(raw);
9909
+ const hasRefresh = !!parsed?.refresh_token;
9910
+ const expiresAt = parsed?.expires_at || 0;
9911
+ const expiresIn = expiresAt ? Math.round((expiresAt - Date.now()) / 1e3) : 0;
9912
+ console.log(`[oauth] cached token for ${email}: hasRefresh=${hasRefresh}, expiresIn=${expiresIn}s`);
9913
+ return parsed;
9893
9914
  } catch {
9894
9915
  return null;
9895
9916
  }