Repository navigation
fix(webui): show an error when a control panel popup fails with status 0 - #4453
Conversation
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.
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().
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe 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. ChangesMessage-box load failure handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
* 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().
Rootfs patch
0089-WebUI-MessagBoxFailureWarning.patchadds anonFailurehandler tocpMessageBox.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), soonFailureis not called in that case:Ajax.Updaterfills the popup with the empty response and onlyonCompleteruns, leaving the popup open without content.This PR:
onFailureinto a localshowLoadError(statusText)helper,onCompletefortrans.status == 0(and returns before showing the popup),onFailurefor 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(.origand 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.validateagainst the current pinc9553f93: PASS, all 50 patches apply with zero fuzz.masteronly inwww/webui/webui.js, and only inLoadFromFile()as described above;node --checkpasses for the resultingwebui.js.Generated by Claude Code
Summary by CodeRabbit