Skip to content

Conversation

@Solventerritory
Copy link

@Solventerritory Solventerritory commented Dec 1, 2025

Fixes video upload failures that happened only in deployed environments.

What changed:

  • Added server-side checks for missing API key and validated uploaded payload & mime type.
  • Improved server error logging and returned readable JSON error messages.
  • Client-side upload flow now checks HTTP status and surfaces error messages to the UI.
  • Added a helper script and README notes to reproduce uploads locally and debug deployments.

How to test locally:

  • Ensure VITE_GEMINI_API_KEY is set (via .env or environment).
  • npm install && npm run dev in the /video folder.
  • Use video/test-upload.sh or drag/drop mp4s in the UI to verify behavior and error messages.

Follow-ups:

  • Consider allowing fallbacks for application/octet-stream uploads in production environments (if the host strips MIME types)
  • Consider a migration away from /tmp for environments that don't allow local FS write operations.
    BUG: Video Analysis upload file fails #30

@gemini-code-assist
Copy link

Summary of Changes

Hello @Solventerritory, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the robustness and user experience of video uploads, particularly in deployed environments. It addresses issues where uploads would silently fail due to missing API keys or incorrect file handling by introducing comprehensive server-side validation and structured error responses. On the client side, these detailed error messages are now properly surfaced to the user, transforming previously invisible failures into actionable feedback. Additionally, new documentation and a testing script empower developers to more easily diagnose and resolve upload-related problems locally.

Highlights

  • Enhanced Server-Side Validation: Implemented checks for missing API keys, invalid upload payloads, and incorrect MIME types to prevent silent failures during video uploads.
  • Improved Error Reporting: The server now returns structured JSON error messages and logs errors more comprehensively, making debugging easier for both server and client issues.
  • Client-Side Error Display: The user interface now correctly processes and displays detailed server-side error messages, providing actionable feedback to the user.
  • Debugging Tools: A new README and a helper script (test-upload.sh) have been added to facilitate local testing and troubleshooting of video upload issues, especially those related to deployment environments.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves error handling for video uploads by adding server-side validation and surfacing errors to the client. The changes are well-structured and include helpful additions like a test script and documentation. My review focuses on a few areas where error propagation can be made more robust to prevent potential issues on the client side. Specifically, I've pointed out that some functions swallow errors instead of re-throwing them, which can lead to unexpected client behavior. I've also suggested a small refinement to the error message display in the UI for better user experience.

Solventerritory and others added 4 commits December 1, 2025 06:59
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant