@bobfrankston/iflow-direct 0.1.3 → 0.1.5

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/imap-native.d.ts CHANGED
@@ -117,7 +117,8 @@ export declare class NativeImapClient {
117
117
  getMessageCount(mailbox: string): Promise<number>;
118
118
  /** Inactivity timeout — how long to wait with NO data before declaring the connection dead.
119
119
  * This is NOT a wall-clock timeout. Timer resets every time data arrives from the server.
120
- * A large FETCH returning data continuously will never timeout. */
120
+ * A large FETCH returning data continuously will never timeout.
121
+ * 60s accommodates Gmail which is slow on SEARCH for large folders. */
121
122
  private inactivityTimeout;
122
123
  /** Fetch chunk sizes — start small for quick first paint, ramp up for throughput */
123
124
  private static INITIAL_CHUNK_SIZE;
package/imap-native.js CHANGED
@@ -456,8 +456,9 @@ export class NativeImapClient {
456
456
  // ── Low-level command handling ──
457
457
  /** Inactivity timeout — how long to wait with NO data before declaring the connection dead.
458
458
  * This is NOT a wall-clock timeout. Timer resets every time data arrives from the server.
459
- * A large FETCH returning data continuously will never timeout. */
460
- inactivityTimeout = 30000;
459
+ * A large FETCH returning data continuously will never timeout.
460
+ * 60s accommodates Gmail which is slow on SEARCH for large folders. */
461
+ inactivityTimeout = 60000;
461
462
  /** Fetch chunk sizes — start small for quick first paint, ramp up for throughput */
462
463
  static INITIAL_CHUNK_SIZE = 25;
463
464
  static MAX_CHUNK_SIZE = 500;
package/imap-protocol.js CHANGED
@@ -246,7 +246,9 @@ function unquote(s) {
246
246
  function decodeImapString(s) {
247
247
  if (!s)
248
248
  return "";
249
- return s.replace(/=\?([^?]+)\?([BQ])\?([^?]+)\?=/gi, (_match, charset, encoding, text) => {
249
+ // RFC 2047 §6.2: whitespace between adjacent encoded-words must be ignored
250
+ const unfolded = s.replace(/\?=\s+=\?/g, "?==?");
251
+ return unfolded.replace(/=\?([^?]+)\?([BQ])\?([^?]+)\?=/gi, (_match, charset, encoding, text) => {
250
252
  try {
251
253
  const cs = charset.toLowerCase().replace(/^utf8$/, "utf-8");
252
254
  if (encoding.toUpperCase() === "B") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow-direct",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Direct IMAP client — transport-agnostic, no Node.js dependencies, browser-ready",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",