Skip to content

Conversation

christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Sep 19, 2025

Summary

Fixed CLOUD-FRONTEND-STAGING-13 where DeviceInfo component throws TypeError when accessing undefined device properties.

Root Cause:
SystemStats API returning empty devices array caused props.stats.devices[0] to be undefined, leading to property access errors in Vue template rendering.

Changes

  • What: Added defensive programming to DeviceInfo and SystemStatsPanel components with null checks and graceful error handling
  • Dependencies: Added i18n keys for error messages

Review Focus

Component prop validation and error boundary patterns for handling malformed API responses. The watchEffect debugging hook logs missing devices scenarios without impacting production performance.

┆Issue is synchronized with this Notion page by Unito

…or on undefined device

Tests reproduce the exact error: "TypeError: Cannot read properties of undefined (reading 'name')"
occurring in DeviceInfo component when props.device is undefined.

Root cause scenarios tested:
- DeviceInfo component receives undefined device prop
- SystemStatsPanel passes undefined device when devices array is empty
- API response malformation leading to missing device data
- Edge cases with corrupted or missing SystemStats data

Sentry URL: https://comfy-org.sentry.io/issues/6804418395/?project=4509681221369857

Tests currently fail as expected, proving the bug exists.
Next: implement defensive programming to handle undefined device props.
…ndefined device

Fixes TypeError: Cannot read properties of undefined (reading 'name')
occurring in DeviceInfo component when device prop is undefined.

Changes:
- DeviceInfo: Add null checks and graceful error handling for undefined device prop
- DeviceInfo: Enhanced formatValue to return 'N/A' for null/undefined values
- SystemStatsPanel: Add guard clauses for empty devices array
- SystemStatsPanel: Display helpful message when no devices available
- Added monitoring to log when devices array is missing for debugging
- Added i18n keys for error messages

Root cause: Component attempted to access properties on undefined device object
when SystemStats API returned empty devices array or malformed data.

Solution: Defensive programming with null checks and user-friendly error messages.

Tests updated to verify graceful handling instead of throwing errors.

Sentry URL: https://comfy-org.sentry.io/issues/6804418395/?project=4509681221369857
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 19, 2025
Copy link

github-actions bot commented Sep 19, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 09/19/2025, 08:58:42 AM UTC

📈 Summary

  • Total Tests: 449
  • Passed: 419 ✅
  • Failed: 0
  • Flaky: 1 ⚠️
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 412 / ❌ 0 / ⚠️ 1 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 4 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@christian-byrne christian-byrne changed the title fix: Resolve Sentry issue CLOUD-FRONTEND-STAGING-13 - TypeError on undefined device fix: about panel error when device not supplied in system_stats response Sep 19, 2025
@christian-byrne christian-byrne marked this pull request as draft September 19, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant