Skip to content

Hot fix/182 fix version and post extraction#183

Open
agusPatrito wants to merge 5 commits into
release/3.5.1from
hot-fix/182-fix-version-and-post-extraction
Open

Hot fix/182 fix version and post extraction#183
agusPatrito wants to merge 5 commits into
release/3.5.1from
hot-fix/182-fix-version-and-post-extraction

Conversation

@agusPatrito
Copy link
Copy Markdown
Collaborator

Summary

  • Fix false "new version available" warning: VITE_APP_VERSION was only defined in .env.development, so production builds had undefined as the current version, triggering the warning on every launch. Fixed by injecting the version from package.json at build time via Vite's define option.

  • Fix frozen spinner after frame extraction: riverCli() was fire-and-forget, causing the IPC handler to return before extraction finished. Also, on extraction failure the catch block returned undefined, triggering a TypeError in the renderer that left isLoading = true indefinitely. Fixed by awaiting riverCli() and returning a proper error object from the catch block.

  • Version bump: 3.5.0 → 3.5.1

agusPatrito and others added 5 commits May 28, 2026 10:01
- Inject VITE_APP_VERSION from package.json at build time via vite.config.ts
  define, so production builds no longer compare undefined to the latest
  release version
- Return an error object from firstFrame.ts on extraction failure instead
  of undefined, preventing a downstream TypeError in the renderer
- Dispatch setLoading(false) in the catch block of onSetVideoParameters so
  the UI always unfreezes even when extraction fails
@agusPatrito agusPatrito requested a review from nico-stefani May 28, 2026 15:53
@agusPatrito agusPatrito self-assigned this May 28, 2026
@agusPatrito agusPatrito added the bug Something isn't working label May 28, 2026
Copy link
Copy Markdown

@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 bumps the application version from 3.5.0 to 3.5.1 across several configuration and documentation files, and improves error handling when extracting the first frame. Specifically, the Electron IPC handler now returns caught errors, and the frontend hook throws an error and resets loading states accordingly. Feedback on these changes includes a recommendation to check if the IPC result is nullish to prevent a potential TypeError when accessing its properties, and a suggestion to use path.resolve with __dirname when reading package.json in the Vite configuration to avoid issues with varying working directories.

Comment on lines +225 to +227
if (result?.error) {
throw new Error(result.error);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If result is null or undefined (e.g., due to an IPC failure), result?.error will evaluate to undefined and no error will be thrown here. However, on line 230, result.initial_frame is accessed directly, which will trigger a TypeError. Checking if result itself is nullish prevents this potential crash.

Suggested change
if (result?.error) {
throw new Error(result.error);
}
if (!result || result.error) {
throw new Error(result?.error || 'Failed to extract first frame');
}

Comment thread gui/vite.config.ts
import react from '@vitejs/plugin-react';
import * as os from 'os';

const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using a relative path like './package.json' relies on the current working directory (CWD) of the process running Vite. If Vite is executed from a different directory (e.g., the repository root or via a monorepo task runner), this read will fail. Resolving the path relative to __dirname using path.resolve is much more robust.

Suggested change
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
const { version } = JSON.parse(readFileSync(path.resolve(__dirname, 'package.json'), 'utf-8'));

@agusPatrito agusPatrito changed the base branch from main to release/3.5.1 June 2, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant