Skip to content

feat: Meaningful error notification if file upload fails due to uploading invalid file#196

Merged
Roopan-Microsoft merged 9 commits intodevfrom
ve-file-upload-restrict
Aug 28, 2025
Merged

feat: Meaningful error notification if file upload fails due to uploading invalid file#196
Roopan-Microsoft merged 9 commits intodevfrom
ve-file-upload-restrict

Conversation

@Vemarthula-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

https://dev.azure.com/CSACTOSOL/CSA%20Solutioning/_workitems/edit/22335/

This pull request improves the file upload experience in the FileUploadZone component by adding stricter validation for uploaded files and providing clear feedback to users when files are rejected. The changes ensure that only .sql files are accepted and that users are informed of any issues with their uploads, such as invalid file type or exceeding the size limit.

File validation and error handling improvements:

  • Added a manual check to ensure only files with a .sql extension are accepted, regardless of MIME type, and constructed detailed error messages for invalid files and files exceeding the size limit. These errors are displayed to the user.
  • Introduced the fileRejectionErrors state to track and display file rejection reasons, and ensured errors are cleared when valid files are uploaded or the upload is canceled. [1] [2]
  • Updated the UI to show error messages for rejected files using a MessageBar component, making it clear to users why their files were not accepted.

Configuration and documentation updates:

  • Clarified in comments that only .sql files are accepted by extension, and updated the accept property to reinforce this restriction. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances the file upload component by adding stricter validation for uploaded files and providing clear user feedback when files are rejected. The changes ensure only .sql files are accepted and users receive detailed error messages for invalid uploads.

  • Added manual file extension validation to complement existing MIME type checks
  • Implemented comprehensive error handling with user-friendly error messages for file rejections
  • Enhanced UI with error message display using MessageBar component
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/frontend/src/components/uploadButton.tsx Outdated
Comment thread src/frontend/src/components/uploadButton.tsx Outdated
Comment thread src/frontend/src/components/uploadButton.tsx
@Roopan-Microsoft Roopan-Microsoft merged commit 191a726 into dev Aug 28, 2025
6 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the ve-file-upload-restrict branch August 28, 2025 06:21
Ritesh-Microsoft pushed a commit that referenced this pull request Oct 10, 2025
feat:  Meaningful error notification if file upload fails due to uploading invalid file
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.5.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants