fix: Reset Vector Storage shows Success before the reset has finished (#35344)

Confirming Reset Vector Storage/Knowledge in the Documents settings showed a Success toast right away, even when the reset then failed on the server. The toast now waits for the reset and only shows Success once it actually went through.

Fixes #35343
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-30 18:25:44 +04:00
1 parent 36522bbbb6
commit 28ee8cd0b0
2 files changed
+4 -3

No files matched your search

+2 -1
View File
@@ -3025,7 +3025,7 @@ async def reset_vector_db(
request: Request,
user=Depends(get_admin_user),
db: AsyncSession = Depends(get_async_session),
):
) -> bool:
await ASYNC_VECTOR_DB_CLIENT.reset()
await Knowledges.delete_all_knowledge(db=db)
await publish_event(
@@ -3034,6 +3034,7 @@ async def reset_vector_db(
actor=user,
subject_id='default',
)
return True
@router.post('/reset/uploads')
@@ -540,8 +540,8 @@
<ResetVectorDBConfirmDialog
bind:show={showResetConfirm}
on:confirm={() => {
const res = resetVectorDB(localStorage.token).catch((error) => {
on:confirm={async () => {
const res = await resetVectorDB(localStorage.token).catch((error) => {
toast.error(`${error}`);
return null;
});