Skip to content

Conversation

@vdimarco
Copy link
Contributor

@vdimarco vdimarco commented Jan 16, 2026

Summary

  • Fix failing test GlobalError/should display error message in development mode
  • The test was using screen.getByText('Test error message') which failed because the component now renders Error: {error.name}: {error.message} format
  • Updated to use a function matcher that correctly identifies the error message within the paragraph element

Changes

  • Updated src/app/__tests__/global-error.test.tsx to use a function matcher instead of exact text match
  • Also updated the production mode test for consistency

Test plan

  • All GlobalError tests pass locally (11/11)

🤖 Generated with Claude Code

Greptile Summary

This PR fixes a failing test in the GlobalError component test suite. The test was updated to match the component's error display format which was changed in a previous commit.

The PR also includes several unrelated fixes for the Tauri desktop app:

  • Added Privy authentication environment variables to the desktop build workflow
  • Removed duplicate tray icon configuration from tauri.conf.json
  • Enhanced browser detection to identify and handle Tauri desktop environments
  • Added comprehensive test coverage for the new Tauri detection functionality

Main Changes:

  • Updated global-error.test.tsx to use a function matcher instead of exact text matching to accommodate the error format: Error: {error.name}: {error.message}
  • Added isTauriDesktop() function to disable embedded wallets on Tauri apps (tauri.localhost is not HTTPS)
  • Fixed desktop build workflow to include required environment variables

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • All changes are test fixes and desktop app improvements. The test update correctly addresses the failing test by using a proper matcher for the updated error display format. The desktop app fixes add missing functionality and remove configuration issues. No logic bugs, security issues, or breaking changes detected.
  • No files require special attention

Important Files Changed

Filename Overview
src/app/tests/global-error.test.tsx Fixed test matcher to accommodate the updated error display format (Error: {error.name}: {error.message})
.github/workflows/desktop-build.yml Added required Privy authentication environment variables for desktop app builds
src-tauri/tauri.conf.json Removed duplicate tray icon configuration to fix desktop app issues
src/lib/browser-detection.ts Added Tauri desktop detection to disable embedded wallets (tauri.localhost is not HTTPS)
src/lib/tests/browser-detection.test.ts Added comprehensive test coverage for Tauri desktop detection functionality

Sequence Diagram

sequenceDiagram
    participant Test as Test Suite
    participant Component as GlobalError Component
    participant DOM as Rendered DOM
    
    Note over Test,DOM: Test Execution Flow
    
    Test->>Component: render(<GlobalError error={mockError} reset={mockReset} />)
    Component->>Component: Format error message as "Error: {error.name}: {error.message}"
    Component->>DOM: Render error details in <p> tag
    
    Note over Test,DOM: Previous Test (Failed)
    Test->>DOM: screen.getByText('Test error message')
    DOM-->>Test: ❌ Not found (exact match failed)
    
    Note over Test,DOM: Updated Test (Passes)
    Test->>DOM: screen.getByText((content, element) => {...})
    DOM->>DOM: Check element.tagName === 'P'
    DOM->>DOM: Check content.includes('Test error message')
    DOM-->>Test: ✅ Found matching element
Loading

root and others added 5 commits January 16, 2026 16:06
The desktop app was showing 'Something went wrong' because NEXT_PUBLIC_PRIVY_APP_ID
was not set during the build. Added required environment variables from secrets.
The tray icon was being created twice - once by the trayIcon config in tauri.conf.json
and once programmatically in lib.rs setup_tray(). This caused two Gatewayz icons
to appear in the Windows taskbar. Removed the config since the code handles it.
- Add 'Show error details' button visible only in desktop app
- Display full error name, message, and stack trace
- Console log errors for debugging
- Helps diagnose 'Something went wrong' errors when DevTools unavailable
Tauri desktop apps use tauri.localhost which is not HTTPS.
This causes Privy's embedded wallet to throw:
'Embedded wallet is only available over HTTPS'

- Add isTauriDesktop() function to detect Tauri environment
- Update shouldDisableEmbeddedWallets() to disable wallets in Tauri
- Add tests for Tauri detection
- Update getBrowserEnvironmentInfo() to include isTauri field
The GlobalError component was updated to show error details in the format
"Error: {error.name}: {error.message}" instead of just "{error.message}".
This updates the test to use a function matcher that finds the error message
within the correct element, avoiding issues with the regex matching multiple
elements due to the "Error:" prefix in the strong tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
gatewayz-frontend Error Error Jan 16, 2026 5:57pm

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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