Skip to content

fix(webui): show an error when a control panel popup fails with status 0 - #4453

Merged
jens-maus merged 1 commit into
masterfrom
jens-maus/fix-0089-messagebox-status-0
Oct 16, 2026
Merged

jens-maus merged 1 commit into
masterfrom
jens-maus/fix-0089-messagebox-status-0

Conversation

@jens-maus

@jens-maus jens-maus commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Rootfs patch 0089-WebUI-MessagBoxFailureWarning.patch adds an onFailure handler to cpMessageBox.LoadFromFile(), so a control panel popup that fails to load shows an error instead of an empty popup that blocks the WebUI.

Prototype treats HTTP status 0 (e.g. a network error or an aborted request) as success (success() returns !status || 2xx), so onFailure is not called in that case: Ajax.Updater fills the popup with the empty response and only onComplete runs, leaving the popup open without content.

This PR:

  • moves the error handling of onFailure into a local showLoadError(statusText) helper,
  • calls it from onComplete for trans.status == 0 (and returns before showing the popup),
  • keeps onFailure for HTTP error status codes.

This was found by CodeRabbit in the review of OpenCCU/OpenCCU-Base#205 (native migration of patch 0089) and will be mirrored there once merged.

The workspaces of the later rootfs patches that contain this code in their webui.js (.orig and modified files, 50 files) are updated with the same text replacement. After regenerating, only patch 0089 changes; all other patches are byte-identical.

Validation

  • create_patches.sh --check: clean. base-patch-migration.py index: PASS (50 patches), index updated for patch 0089. The migration unit tests passed.
  • validate against the current pin c9553f93: PASS, all 50 patches apply with zero fuzz.
  • The validation manifest differs from the current master only in www/webui/webui.js, and only in LoadFromFile() as described above; node --check passes for the resulting webui.js.

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Message boxes now handle failed requests—including responses with status 0—by hiding the popup and displaying an appropriate error message. Successful requests continue to display as before.
  • New Features
    • Error messages can be customized for message-box requests.

Prototype treats HTTP status 0 (e.g. a network error) as success, so the onFailure handler of cpMessageBox.LoadFromFile() added by rootfs patch 0089 is not called and the popup stays open without content. Handle status 0 in onComplete with the same error handling, now shared in showLoadError(). The later workspaces containing this code are updated accordingly; only patch 0089 changes.
@jens-maus jens-maus added 🏷️ OCCU OpenCCU-Base linked issues/PRs 🏷️ WebUI This refs the WebUI component labels Oct 16, 2026 — with Claude
jens-maus added a commit to OpenCCU/OpenCCU-Base that referenced this pull request Oct 16, 2026
This applies the fix of OpenCCU/OpenCCU#4453, as found in the review of
this PR:

- Prototype treats HTTP status 0 (e.g. a network error) as success, so
  onFailure is not called. Handle status 0 in onComplete with the same
  error handling, now shared in showLoadError().
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: OpenCCU/OpenCCU/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 60351d49-5ffe-4bc5-850a-2c2e72a389eb
📥 Commits

Reviewing files that changed from the base of the PR and between a7a0976 and 5f27883.

⛔ Files ignored due to path filters: 25
  • buildroot-external/package/openccu-base/rootfs-patches/0095-WebUI-userSysVarTblMoveUpDown/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0097-WebUI-SetSysvarValueByUser/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0099-WebUI-Add-DeviceRenameAllChannels/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0104-WebUI-Add-AssignFunctionAndRoomToHmRFChan0/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0109-WebUI-Fix-SystemLanguageDefaultNames/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0111-WebUI-Fix-Translation-Performance/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0119-WebUI-Fix-ProofAndSetValue/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0122-WebUI-ProgramExecutionWithConditionCheck/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0131-WebUI-ShowAddonUpdatesOnStartpage/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0132-WebUI-Fix-UnitDisplay/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0135-WebUI-Add-ControlPanel-AdvancedSettings/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0138-WebUI-Add-SettingsAccessInStatusAndControl/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0145-WebUI-NaturalSorting/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0146-WebUI-ImprovedStartpageLayout/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0151-WebUI-Add-DeviceRestoreConfigButton/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0153-WebUI-Fix-ImproveImgUpdates/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0154-WebUI-DynamicResizing/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0155-WebUI-Add-HmIP-RFUSB-Support/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0156-WebUI-ImprovedConfirmDeletePopup/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0161-WebUI-Add-ShowRFGatewayInDeviceList/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0170-WebUI-RegexSearchInDeviceLists/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0171-WebUI-Add-HmIPKeyTransceiverCentralLinkConfiguration/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0173-WebUI-SendPOSTRequest/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0183-WebUI-ImprovedFirmwareupdateDialog/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
  • buildroot-external/package/openccu-base/rootfs-patches/0205-WebUI-Remove-FieldTestBetaFw/rootfs/www/webui/webui.js.orig is excluded by !**/*.orig
📒 Files selected for processing: 28
  • buildroot-external/package/openccu-base/rootfs-patches/0089-WebUI-MessagBoxFailureWarning.patch
  • buildroot-external/package/openccu-base/rootfs-patches/0089-WebUI-MessagBoxFailureWarning/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0095-WebUI-userSysVarTblMoveUpDown/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0097-WebUI-SetSysvarValueByUser/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0099-WebUI-Add-DeviceRenameAllChannels/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0104-WebUI-Add-AssignFunctionAndRoomToHmRFChan0/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0109-WebUI-Fix-SystemLanguageDefaultNames/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0111-WebUI-Fix-Translation-Performance/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0119-WebUI-Fix-ProofAndSetValue/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0122-WebUI-ProgramExecutionWithConditionCheck/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0131-WebUI-ShowAddonUpdatesOnStartpage/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0132-WebUI-Fix-UnitDisplay/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0135-WebUI-Add-ControlPanel-AdvancedSettings/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0138-WebUI-Add-SettingsAccessInStatusAndControl/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0145-WebUI-NaturalSorting/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0146-WebUI-ImprovedStartpageLayout/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0151-WebUI-Add-DeviceRestoreConfigButton/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0153-WebUI-Fix-ImproveImgUpdates/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0154-WebUI-DynamicResizing/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0155-WebUI-Add-HmIP-RFUSB-Support/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0156-WebUI-ImprovedConfirmDeletePopup/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0161-WebUI-Add-ShowRFGatewayInDeviceList/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0170-WebUI-RegexSearchInDeviceLists/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0171-WebUI-Add-HmIPKeyTransceiverCentralLinkConfiguration/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0173-WebUI-SendPOSTRequest/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0183-WebUI-ImprovedFirmwareupdateDialog/rootfs/www/webui/webui.js
  • buildroot-external/package/openccu-base/rootfs-patches/0205-WebUI-Remove-FieldTestBetaFw/rootfs/www/webui/webui.js
  • docs/base-patch-migration/index.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The message-box loader now treats completed requests with status 0 as failures. It shares error handling with request failures, while other completed requests retain the existing display behavior. The patch migration manifest records the updated patch size and SHA-256 value.

Changes

Message-box load failure handling

Layer / File(s) Summary
Shared handling for load failures
buildroot-external/package/openccu-base/rootfs-patches/0089-WebUI-MessagBoxFailureWarning.patch, buildroot-external/package/openccu-base/rootfs-patches/*/rootfs/www/webui/webui.js, docs/base-patch-migration/index.json
Status-0 completions now follow the same error path as request failures. The handler hides the popup layers and shows the configured translated error or calls Ajax_failure. Other completed requests retain the existing display behavior. The migration manifest updates the patch’s added-line count and SHA-256 value.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5f278

The popup load-failure change has no identified issue that needs resolution before merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: showing an error when a control panel popup request fails with status 0.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (28 skipped: 2 unsupported, 26 too large.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jens-maus jens-maus added this to the next release milestone Oct 16, 2026
@jens-maus
jens-maus merged commit 731831b into master Oct 16, 2026
27 checks passed
@jens-maus
jens-maus deleted the jens-maus/fix-0089-messagebox-status-0 branch October 16, 2026 09:43
jens-maus added a commit to OpenCCU/OpenCCU-Base that referenced this pull request Oct 16, 2026
* webui: show an error when a control panel popup fails to load

This applies OpenCCU rootfs patch 0089-WebUI-MessagBoxFailureWarning.patch:

- cpMessageBox.LoadFromFile() gets an onFailure handler. If the
  control panel page cannot be loaded, it hides the empty popup and
  its overlay and shows an error message instead of leaving the
  WebUI blocked.
- CreateCPPopup(), cpMessageBox.initialize() and LoadFromFile() accept
  an optional errorLbl translation key for that message; without it,
  the common Ajax_failure() message is shown.

* webui: show an error when a control panel popup fails with status 0

This applies the fix of OpenCCU/OpenCCU#4453, as found in the review of
this PR:

- Prototype treats HTTP status 0 (e.g. a network error) as success, so
  onFailure is not called. Handle status 0 in onComplete with the same
  error handling, now shared in showLoadError().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ OCCU OpenCCU-Base linked issues/PRs 🏷️ WebUI This refs the WebUI component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant