{"record":{"id":"97af5d4b1ba9e262","repo":"toeverything/AFFiNE","slug":"requesttimeout","errorCode":"RequestTimeout","errorMessage":"Request timeout","messagePattern":"Request timeout","errorType":"exception","errorClass":"RequestTimeoutError","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/blocksuite/ai/provider/event-source.ts","lineNumber":89,"sourceCode":"        } else {\n          resolveMessagePromise();\n        }\n        eventSource.close();\n      });\n\n      try {\n        while (\n          eventSource.readyState !== EventSource.CLOSED &&\n          !signal?.aborted\n        ) {\n          if (messageQueue.length === 0) {\n            // Wait for the next message or timeout\n            await (timeout\n              ? Promise.race([\n                  messagePromise,\n                  delay(timeout).then(() => {\n                    if (!signal?.aborted) {\n                      throw new RequestTimeoutError();\n                    }\n                  }),\n                ])\n              : messagePromise);\n          } else if (messageQueue.length > 0) {\n            const top = messageQueue.shift();\n            if (top) {\n              yield top;\n            }\n          }\n        }\n      } finally {\n        eventSource.close();\n      }\n    },\n  };\n}\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/blocksuite/ai/provider/event-source.ts#L71-L107","documentation":"Raised as RequestTimeoutError when the AI SSE event source neither delivers a message nor closes within the configured timeout while awaiting the next message and the signal is not aborted. Means the AI backend stopped streaming.","triggerScenarios":"Thrown as RequestTimeoutError in the AI event source stream loop when no message arrives within the configured timeout and the request was not aborted.","commonSituations":"Occurs when an AI streaming request stalls due to a slow or unresponsive server. Check network connectivity and retry the AI action.","solutions":["Retry the request with a longer timeout or check network connectivity.","Increase the event-source timeout if the server legitimately responds slowly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}