fix(powerbi): recover from transient FailedToLoadModel errors#851
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Pull request overview
Adds resilience to the Power BI embed flow by retrying transient FailedToLoadModel failures and improving how embed errors are reported to Sentry.
Changes:
- Detect
FailedToLoadModeland reload the report up toMAX_MODEL_RELOADStimes before showing an error. - Improve Sentry reporting by converting Power BI error payloads into a real
Errorplus structured context. - Extend tests to cover model-load retry behavior and the new reporting shape.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
edge-apps/powerbi/src/services.types.ts |
Extends the Power BI error shape to include a top-level message. |
edge-apps/powerbi/src/services.ts |
Adds model-load retry logic, adjusts event handlers, and reports errors with richer Sentry context. |
edge-apps/powerbi/src/services.test.ts |
Updates mocks and adds tests for retry vs. render-error behavior. |
edge-apps/powerbi/src/services.lib.ts |
Introduces model-load detection and helper functions for Sentry reporting/context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Updated error reporting to include detailed messages in Sentry. - Improved the display of error messages in the UI when reloads fail. - Added tests to verify the correct rendering of error messages.
- Introduced a delay mechanism for retrying failed model loads to improve recovery from transient errors. - Updated error handling to ensure that reload attempts are properly counted and managed. - Enhanced tests to validate the new retry behavior and ensure correct error reporting.
…failures - Added a default error message for better user feedback when loading reports fails. - Refactored the reload logic to prevent duplicate reload attempts and ensure proper error handling. - Enhanced tests to validate the new behavior of error handling and reload scheduling.
PR Type
Bug fix, Tests
Description
Recover transient Power BI model-load failures
Cap automatic report reload attempts
Improve embed error reporting context
Add coverage for reload behavior
Diagram Walkthrough
File Walkthrough
services.lib.ts
Add Power BI model-load error helpersedge-apps/powerbi/src/services.lib.ts
FailedToLoadModeldetection helperMAX_MODEL_RELOADSretry limitErrorsservices.ts
Retry transient Power BI model-load failuresedge-apps/powerbi/src/services.ts
FailedToLoadModelerrorsservices.test.ts
Test model-load reload recovery pathsedge-apps/powerbi/src/services.test.ts
report.reloadsupportservices.types.ts
Extend Power BI error typingedge-apps/powerbi/src/services.types.ts
messagetoPowerBiError