@widgetic/creator 0.3.62 → 0.3.63
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/dist/CreatorApp.svelte
CHANGED
|
@@ -7087,6 +7087,13 @@
|
|
|
7087
7087
|
signal
|
|
7088
7088
|
})
|
|
7089
7089
|
.then((finalOp) => {
|
|
7090
|
+
if (!settled && !signal?.aborted && onMessage) {
|
|
7091
|
+
try {
|
|
7092
|
+
onMessage(finalOp as OperationStatus);
|
|
7093
|
+
} catch (callbackError) {
|
|
7094
|
+
console.warn('waitForOperation terminal callback error', callbackError);
|
|
7095
|
+
}
|
|
7096
|
+
}
|
|
7090
7097
|
settle('resolve', finalOp as OperationStatus);
|
|
7091
7098
|
})
|
|
7092
7099
|
.catch((streamError) => {
|
|
@@ -84,12 +84,12 @@ export function streamOperationUpdates(operationId, options) {
|
|
|
84
84
|
reader = response.body.getReader();
|
|
85
85
|
const decoder = new TextDecoder();
|
|
86
86
|
let buffer = '';
|
|
87
|
+
// Start idle timer before any operation payload arrives.
|
|
87
88
|
armWatchdog();
|
|
88
89
|
while (true) {
|
|
89
90
|
const { done, value } = await reader.read();
|
|
90
91
|
if (done)
|
|
91
92
|
break;
|
|
92
|
-
armWatchdog();
|
|
93
93
|
buffer += decoder.decode(value, { stream: true });
|
|
94
94
|
// SSE frames are `data: {...}\n\n`; keepalive comment frames carry
|
|
95
95
|
// no data line and are skipped.
|
|
@@ -107,6 +107,10 @@ export function streamOperationUpdates(operationId, options) {
|
|
|
107
107
|
continue;
|
|
108
108
|
try {
|
|
109
109
|
const op = JSON.parse(dataLine);
|
|
110
|
+
// Only reset idle timer on real operation payloads — SSE
|
|
111
|
+
// `: keepalive` comment frames must not suppress polling fallback
|
|
112
|
+
// when the terminal `completed` event is lost behind a proxy.
|
|
113
|
+
armWatchdog();
|
|
110
114
|
onMessage?.(op);
|
|
111
115
|
const status = String(op?.status || '').toLowerCase();
|
|
112
116
|
if (TERMINAL_STATUSES.has(status)) {
|