Skip to content

fix(settings): keep the page usable when a settings view fails to build - #507

Merged
FreekVR merged 1 commit into
mainfrom
fix/isolate-settings-view-build-errors
Jul 16, 2026
Merged

fix(settings): keep the page usable when a settings view fails to build#507
FreekVR merged 1 commit into
mainfrom
fix/isolate-settings-view-build-errors

Conversation

@FreekVR

@FreekVR FreekVR commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Stops one broken settings view from taking down the whole plugin settings page.

Corrupt account data - for example a mangled insurance format in the stored carrier capabilities - could make a single settings view throw while the page was being built, which crashed the entire page. That left the user unable to re-enter their API key or refresh their data, which are exactly the actions that would fix it. Each view is now built in isolation: a failing view is skipped, its original error is logged, and a notification names the section that failed, while every other section (including the API key / debug box) keeps working so the user can recover on their own.

Fixes INT-1722

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 15, 2026 14:50
@FreekVR
FreekVR requested a review from a team as a code owner July 15, 2026 14:50
@github-project-automation github-project-automation Bot moved this to Todo in PDK Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the plugin settings page rendering so that if one settings view throws during construction (including PHP Errors caused by corrupt stored account data), the rest of the settings page still renders, allowing users to recover by re-entering an API key or refreshing account data.

Changes:

  • Wraps each settings view build in PluginSettingsViewContext with a try/catch (Throwable) so a single failing view is skipped instead of crashing the page.
  • Logs the original failure and shows a user-facing error notification identifying which settings section failed.
  • Adds unit tests ensuring only the failing section is dropped, exactly one error notification is shown, and the original throwable is logged.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Context/Model/PluginSettingsViewContext.php Builds each settings view in isolation; on failure logs + notifies and continues building remaining sections.
tests/Unit/Context/Model/PluginSettingsViewContextTest.php Adds coverage for partial rendering, notification behavior, and logging when a view fails to build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.29%. Comparing base (653aaff) to head (5b82eb7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #507   +/-   ##
=========================================
  Coverage     94.29%   94.29%           
- Complexity     2390     2391    +1     
=========================================
  Files           351      351           
  Lines          7655     7663    +8     
=========================================
+ Hits           7218     7226    +8     
  Misses          437      437           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Corrupt account data - for example a mangled insurance format in the stored carrier capabilities - could make one settings view throw while the plugin settings page was being built, which took down the entire page. The user could then no longer re-enter their API key or refresh their data, the exact actions needed to recover.

Each view is now built in isolation. A failing view is skipped, its original error is logged, and the user gets a notification naming the section that failed. Every other section keeps rendering, including the box for re-saving the API key or refreshing data, so the user can recover on their own.

Fixes INT-1722

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FreekVR
FreekVR force-pushed the fix/isolate-settings-view-build-errors branch from 04c5213 to 5b82eb7 Compare July 15, 2026 15:06
@github-project-automation github-project-automation Bot moved this from Todo to Testing in PDK Jul 15, 2026
@myparcel-bot myparcel-bot Bot added the approved (Auto) label Jul 15, 2026
@FreekVR
FreekVR added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit cf95dce Jul 16, 2026
14 checks passed
@FreekVR
FreekVR deleted the fix/isolate-settings-view-build-errors branch July 16, 2026 09:46
@github-project-automation github-project-automation Bot moved this from Testing to Done in PDK Jul 16, 2026
myparcel-bot Bot added a commit that referenced this pull request Jul 16, 2026
## [4.4.1](v4.4.0...v4.4.1) (2026-07-16)

### 🐛 Bug Fixes

* **settings:** keep the page usable when a settings view fails to build ([#507](#507)) ([cf95dce](cf95dce))
@myparcel-bot

myparcel-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 4.4.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants