Skip to content

fix(app): avoid desktop blank screen from modulepreload polyfill#1045

Merged
graycyrus merged 5 commits into
tinyhumansai:mainfrom
M3gA-Mind:update/release-files
Apr 30, 2026
Merged

fix(app): avoid desktop blank screen from modulepreload polyfill#1045
graycyrus merged 5 commits into
tinyhumansai:mainfrom
M3gA-Mind:update/release-files

Conversation

@M3gA-Mind
Copy link
Copy Markdown
Contributor

@M3gA-Mind M3gA-Mind commented Apr 30, 2026

Summary

  • disable Vite's modulepreload polyfill in app/vite.config.ts for desktop builds
  • avoid startup crashes in CEF where link.relList.supports can be truthy but non-callable
  • keep the rest of the build pipeline unchanged

Test plan

  • pnpm --filter openhuman-app build
  • Verified built bundle no longer contains the injected modulepreload polyfill startup block
  • N/A: desktop runtime confirmation requires a local GUI launch outside CI; this PR validates the build-level fix and generated bundle diff

M3gA-Mind and others added 4 commits April 30, 2026 16:03
This keeps production release artifacts unchanged while ensuring staging sidecar, bundle lookup, and upload paths align with debug outputs.

Made-with: Cursor
Serialize env-mutating core_process tests with a shared lock so OPENHUMAN_* overrides do not race under parallel test execution in CI.

Made-with: Cursor
Prevent startup blank-screen crashes in desktop builds where `link.relList.supports` is present but not callable by turning off the injected modulepreload polyfill.

Made-with: Cursor
@M3gA-Mind M3gA-Mind requested a review from a team April 30, 2026 11:29
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

📝 Walkthrough

Walkthrough

The PR updates the CI/CD release workflow to use profile-dependent build paths (debug for staging, release for production), adds test synchronization via a process-wide mutex to prevent concurrent environment mutation, and disables Vite's modulepreload polyfill in the frontend build configuration.

Changes

Cohort / File(s) Summary
Release Workflow
.github/workflows/release.yml
Replaces hard-coded target/.../release/ paths with profile-dependent $BUILD_PROFILE variable. Passes --release flag to sidecar build only for release profile. Invokes cargo tauri build --debug for staging builds. Updates artifact discovery and upload paths for installers, app bundles, and desktop packages to use the dynamic profile directory.
Test Synchronization
app/src-tauri/src/core_process_tests.rs
Adds process-wide env_lock mutex acquired at the start of env-parsing/bin-resolution tests to prevent concurrent std::env mutation. Removes manual cleanup of OPENHUMAN_CORE_BIN in precedence test, relying on existing EnvGuard drop-based restoration.
Frontend Build Configuration
app/vite.config.ts
Disables Vite's modulepreload polyfill to prevent runtime errors in environments where link.relList.supports is truthy but not callable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • senamakel

Poem

🐰 A profile-aware release takes flight,
Debug for staging, release shines bright,
Tests now locked, no race conditions here,
Vite's polyfill gone, the path is clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly references the main fix in the changeset: disabling Vite's modulepreload polyfill to prevent desktop blank-screen crashes.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

597-605: 💤 Low value

Sentry symbol upload paths still hardcoded to release.

The Sentry debug symbol upload step at lines 599 and 627 uses hardcoded release in the path:

deps_dir="target/${MATRIX_TARGET}/release/deps"

For staging builds (which now use debug profile), this path won't exist, so the upload will be silently skipped. While this is acceptable because staging builds skip Sentry uploads anyway (guarded by release_enabled == 'true'), the code could be confusing for future maintainers.

Consider updating for consistency, or adding a comment explaining the guard makes this moot:

-          deps_dir="target/${MATRIX_TARGET}/release/deps"
+          # Only runs for production (release_enabled == 'true'), so 'release' profile is correct
+          deps_dir="target/${MATRIX_TARGET}/release/deps"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 597 - 605, Replace the hardcoded
"release" path used to build deps_dir so it respects the build profile; e.g.,
change deps_dir="target/${MATRIX_TARGET}/release/deps" to use a profile variable
like deps_dir="target/${MATRIX_TARGET}/${MATRIX_PROFILE:-release}/deps" (ensure
MATRIX_PROFILE is set in the matrix or defaults to "release"), or alternatively
add a brief comment next to the deps_dir assignment referencing the
release_enabled guard; update occurrences around the Sentry upload step and the
variable names MATRIX_TARGET, MATRIX_PROFILE and release_enabled to keep
behavior consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 597-605: Replace the hardcoded "release" path used to build
deps_dir so it respects the build profile; e.g., change
deps_dir="target/${MATRIX_TARGET}/release/deps" to use a profile variable like
deps_dir="target/${MATRIX_TARGET}/${MATRIX_PROFILE:-release}/deps" (ensure
MATRIX_PROFILE is set in the matrix or defaults to "release"), or alternatively
add a brief comment next to the deps_dir assignment referencing the
release_enabled guard; update occurrences around the Sentry upload step and the
variable names MATRIX_TARGET, MATRIX_PROFILE and release_enabled to keep
behavior consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dce2d1c2-3bd8-4fbe-8342-b94414dad217

📥 Commits

Reviewing files that changed from the base of the PR and between 4997a23 and e22c121.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • app/src-tauri/src/core_process_tests.rs
  • app/vite.config.ts

@graycyrus graycyrus merged commit 680589d into tinyhumansai:main Apr 30, 2026
14 of 15 checks passed
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
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.

2 participants