{"record":{"id":"4b0eac863faa38c7","repo":"Stirling-Tools/Stirling-PDF","slug":"login-request-timed-out-please-check-your-network","errorCode":null,"errorMessage":"Login request timed out. Please check your network connection and try again.","messagePattern":"Login request timed out\\. Please check your network connection and try again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/editor/src/desktop/services/authService.ts","lineNumber":438,"sourceCode":"          );\n        }\n        // Server not found or unreachable\n        else if (\n          errMsg.includes(\"connection refused\") ||\n          errMsg.includes(\"econnrefused\")\n        ) {\n          this.setAuthStatus(\"unauthenticated\", null);\n          throw new Error(\n            \"Cannot connect to server. Please check the server URL and ensure the server is running.\",\n            {\n              cause: error,\n            },\n          );\n        }\n        // Timeout\n        else if (errMsg.includes(\"timeout\") || errMsg.includes(\"timed out\")) {\n          this.setAuthStatus(\"unauthenticated\", null);\n          throw new Error(\n            \"Login request timed out. Please check your network connection and try again.\",\n            {\n              cause: error,\n            },\n          );\n        }\n        // DNS failure\n        else if (\n          errMsg.includes(\"getaddrinfo\") ||\n          errMsg.includes(\"dns\") ||\n          errMsg.includes(\"not found\") ||\n          errMsg.includes(\"enotfound\")\n        ) {\n          this.setAuthStatus(\"unauthenticated\", null);\n          throw new Error(\n            \"Cannot resolve server address. Please check the server URL is correct.\",\n            { cause: error },\n          );","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/frontend/editor/src/desktop/services/authService.ts#L420-L456","documentation":"Thrown when the login error message contains 'timeout' or 'timed out'. The request was sent but no response arrived within the deadline — the network is slow, lossy, or the server is overloaded/stalled. Original error preserved as cause; auth resets to unauthenticated.","triggerScenarios":"The Rust login invoke's HTTP request exceeds its timeout: server under heavy load, a saturated/high-latency link, a reverse proxy with a short upstream timeout, or packet loss causing TCP retransmits.","commonSituations":"User on a congested VPN or mobile hotspot; server doing a long blocking operation (e.g. Supabase cold start) that exceeds the client deadline; intermediate proxy/load balancer timing out before Stirling responds.","solutions":["Retry the login once (transient network slowness often clears).","Move to a more stable/faster network connection.","Check the server's responsiveness directly (curl the /login endpoint) and increase server capacity if it is overloaded.","If behind a proxy, raise the proxy's upstream read/connect timeouts to exceed Stirling's response time."],"exampleFix":"// before: single attempt, no retry\nawait authService.login(server, user, pass);\n\n// after: retry once on timeout\ntry { await authService.login(server, user, pass); }\ncatch (e) {\n  if (e instanceof Error && /timed out/i.test(e.message)) {\n    show('Network slow — retrying…');\n    await authService.login(server, user, pass);\n    return;\n  }\n  throw e;\n}","handlingStrategy":"retry","validationCode":"// estimate link health before login\nif (navigator.onLine === false) { show('You are offline.'); return; }","typeGuard":"function isLoginTimeout(e: unknown): e is Error {\n  return e instanceof Error && /timed out/i.test(e.message);\n}","tryCatchPattern":"async function loginWithRetry(...args: Parameters<typeof authService.login>) {\n  try { return await authService.login(...args); }\n  catch (e) {\n    if (isLoginTimeout(e)) { show('Network slow — retrying…'); return await authService.login(...args); }\n    throw e;\n  }\n}","preventionTips":["Retry once on timeout (transient).","Show network state so users know retries are happening.","Keep the password in memory across the retry, not in a log."],"tags":["network","timeout","retry","desktop"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}