Skip to content

fix(knowledgebase): restore preview/save behavior for local file uploads#7

Open
ponyfly6 wants to merge 1 commit into
mainfrom
codex/bug
Open

fix(knowledgebase): restore preview/save behavior for local file uploads#7
ponyfly6 wants to merge 1 commit into
mainfrom
codex/bug

Conversation

@ponyfly6

Copy link
Copy Markdown
Owner

Motivation

  • Users reported that uploading local text files could leave the preview/save flow unresponsive because the UI allowed advancing before upload metadata was ready and some deployments returned only filePath (no fileUrl).

Description

  • Require uploaded files to be finished and to have produced document metadata before enabling the step advancement by updating nextStepAvailable in step.component.ts to check file.status() === 'done' and that file.document() exists.
  • Allow estimation/preview to run when either fileUrl or filePath is present by changing the loader condition in preview.component.ts to request.fileUrl || request.filePath.
  • Normalize upload response handling in KnowledgeFileUploader (knowledgebase.service.ts) by filling fileUrl from event.body.fileUrl ?? event.body.url and setting uploadedUrl accordingly to cover different backend response shapes.

Testing

  • Ran lint with yarn nx run cloud:lint; the run failed due to an existing repository-level lint/runtime configuration issue (ENOENT: no such file or directory, open '/workspace/xpert/apps/cloud/src/*') that is unrelated to these changes. No unit/integration tests were added for this UI/data-flow change in this PR.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35e9884ac6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

? this.webDocs()?.length > 0
: this.sourceType()[0] === KDocumentSourceType.FileSystem ? !this.fileSystemForm()?.invalid : false
return this.sourceType()[0] === KDocumentSourceType.LocalFile
? !!this.files()?.length && this.files().every((file) => file.status() === 'done' && !!file.document())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle failed uploads before gating next step

This new gate requires every local file to reach done, which turns upload errors into a hard blocker: KnowledgeFileUploader sets status = 'error' on failure, and the local-file UI only shows a delete action once progress() >= 100 (otherwise it renders a non-removal progress button), so a failed upload can become non-removable while nextStepAvailable stays false forever. In that case users cannot proceed with successfully uploaded files and must restart the flow.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant