fix: implement loading timeout, SSE reconnect, and message retry (#857)
* fix: implement loading timeout, SSE reconnect, and message retry - Loading timeout: 30s timeout with retry/cancel buttons to prevent infinite loading - SSE reconnect: Auto-reconnect up to 3 times with exponential backoff (1s, 2s, 4s) - Message retry: Ensure critical messages reach webview with 5s timeout and 3 retries This fix prevents the chat from getting stuck in a permanent loading state and improves reliability of SSE connections and webview communication. Fixes #851 * fix: harden vscode bridge retry flow --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
1fed81439c
commit
4cb918f6cb
@@ -47,6 +47,11 @@ window.addEventListener('message', (event: MessageEvent<BridgeResponse>) => {
|
||||
const response = event.data;
|
||||
if (!response || typeof response.id !== 'string') return;
|
||||
|
||||
const messageId = (response as BridgeResponse & { _msgId?: unknown })._msgId;
|
||||
if (typeof messageId === 'string' && messageId.length > 0) {
|
||||
getVSCodeAPI().postMessage({ type: 'bridge:ack', _msgId: messageId });
|
||||
}
|
||||
|
||||
const pending = pendingRequests.get(response.id);
|
||||
if (pending) {
|
||||
pendingRequests.delete(response.id);
|
||||
|
||||
Reference in New Issue
Block a user