Upload: communicate failure, minor frontend updates (#2048)

* (feat:pause-stream) generator exit

* (feat:pause-stream) close request

* (feat:pause-stream) finally close; google anthropic

* (feat:task_status)communicate failure

* (clean:connector) unused routes

* (feat:file-table) missing skeletons

* (fix:apiKeys) build err

---------

Co-authored-by: GH Action - Upstream Sync <action@github.com>
This commit is contained in:
Manish Madan
2025-10-10 20:04:02 +05:30
committed by GitHub
parent 50bee7c2b0
commit f0b954dbfb
14 changed files with 64 additions and 236 deletions

View File

@@ -291,12 +291,12 @@ function Upload({
id: clientTaskId,
updates: {
status: 'failed',
errorMessage: errorMessage || t('attachments.uploadFailed'),
errorMessage: errorMessage,
},
}),
);
},
[dispatch, t],
[dispatch],
);
const trackTraining = useCallback(
@@ -308,6 +308,15 @@ function Upload({
.getTaskStatus(backendTaskId, null)
.then((response) => response.json())
.then(async (data) => {
if (!data.success && data.message) {
if (timeoutId !== null) {
clearTimeout(timeoutId);
timeoutId = null;
}
handleTaskFailure(clientTaskId, data.message);
return;
}
if (data.status === 'SUCCESS') {
if (timeoutId !== null) {
clearTimeout(timeoutId);
@@ -376,12 +385,12 @@ function Upload({
timeoutId = window.setTimeout(poll, 5000);
}
})
.catch(() => {
.catch((error) => {
if (timeoutId !== null) {
clearTimeout(timeoutId);
timeoutId = null;
}
handleTaskFailure(clientTaskId);
handleTaskFailure(clientTaskId, error?.message);
});
};