فهرست منبع

fix: increase timeout and enable retry for sendEmail and createDraft

Both were using 30s timeout with no retries, causing failures when
Mail.app is slow to establish SMTP connections (common on first call).
Now uses 60s timeout with 1 retry attempt and exponential backoff.
Robert Sweet 3 ماه پیش
والد
کامیت
926991dc4c
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/services/appleMailManager.ts

+ 2 - 2
src/services/appleMailManager.ts

@@ -697,7 +697,7 @@ export class AppleMailManager {
     }
 
     const script = buildAppLevelScript(sendCommand);
-    const result = executeAppleScript(script);
+    const result = executeAppleScript(script, { timeoutMs: 60000, maxRetries: 2 });
 
     if (!result.success) {
       console.error(`Failed to send email: ${result.error}`);
@@ -839,7 +839,7 @@ export class AppleMailManager {
     }
 
     const script = buildAppLevelScript(draftCommand);
-    const result = executeAppleScript(script);
+    const result = executeAppleScript(script, { timeoutMs: 60000, maxRetries: 2 });
 
     if (!result.success) {
       console.error(`Failed to create draft: ${result.error}`);