@bobfrankston/rmfmail 1.1.73 → 1.1.74

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.
@@ -5201,6 +5201,14 @@ var WebMailxDB = class {
5201
5201
  const r = this.get("SELECT body_path FROM messages WHERE account_id = ? AND uid = ?", [accountId, uid]);
5202
5202
  return r?.body_path || "";
5203
5203
  }
5204
+ /** The provider's own message id (Gmail message id) for a uid. Passed to
5205
+ * the Gmail provider's trash/move so it doesn't fall back to a capped
5206
+ * list-and-hash search that misses messages in a large mailbox. "" when
5207
+ * unknown — the provider then uses its (capped) fallback. */
5208
+ getProviderId(accountId, uid) {
5209
+ const r = this.get("SELECT provider_id FROM messages WHERE account_id = ? AND uid = ?", [accountId, uid]);
5210
+ return r?.provider_id || "";
5211
+ }
5204
5212
  updateMessageFlags(accountId, uid, flags) {
5205
5213
  this.run("UPDATE messages SET flags_json = ? WHERE account_id = ? AND uid = ?", [JSON.stringify(flags), accountId, uid]);
5206
5214
  }
@@ -10011,7 +10019,7 @@ var AndroidSyncManager = class {
10011
10019
  if (p.action === "flags" && typeof provider.setFlags === "function") {
10012
10020
  await provider.setFlags(path, p.uid, Array.isArray(p.flags) ? p.flags : p.flags ? [p.flags] : []);
10013
10021
  } else if (p.action === "trash" && typeof provider.trashMessage === "function") {
10014
- await provider.trashMessage(path, p.uid);
10022
+ await provider.trashMessage(path, p.uid, this.db.getProviderId(accountId, p.uid));
10015
10023
  } else if (p.action === "move" && typeof provider.moveMessage === "function") {
10016
10024
  const toId = p.targetFolderId;
10017
10025
  const toPath = folderPath(toId);
@@ -10019,7 +10027,7 @@ var AndroidSyncManager = class {
10019
10027
  this.db.failSyncActionByUid(accountId, p.action, p.uid, `unknown target folder ${toId}`);
10020
10028
  continue;
10021
10029
  }
10022
- await provider.moveMessage(path, p.uid, toPath);
10030
+ await provider.moveMessage(path, p.uid, toPath, this.db.getProviderId(accountId, p.uid));
10023
10031
  } else {
10024
10032
  this.db.failSyncActionByUid(accountId, p.action, p.uid, `provider does not support ${p.action}`);
10025
10033
  continue;