webui: use a unique loop variable in HideCertainParameters() - #80
Conversation
ReGa script variables are shared across the whole script run. The device list in rega/www/pages/tabs/control/hdevichannels.htm iterates over the channels with foreach(tmp, ...). For datapoints without a specific control, dcCreate() calls CreateUnknown(), which calls HideCertainParameters() in datapointconfigurator.fn. That function also declared and iterated with tmp and overwrote the outer loop variable, so only the first channel was shown and ReGaHss logged a script error. Rename the variable to tmpHCP. This natively replaces OpenCCU rootfs patch 0139-WebUI-Fix-ScriptErrorOnUnknownDatapoint.patch.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesParameter filtering
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The rename preserves parameter filtering and avoids the shared-variable collision on the unknown-datapoint path. No material merge risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Original OpenCCU rootfs patch: 0139
Original filename:
0139-WebUI-Fix-ScriptErrorOnUnknownDatapoint.patchOriginal patch:
https://github.com/OpenCCU/OpenCCU/blob/8e9fdb425d208c21ab12636006a8d3e1a2342f15/buildroot-external/package/openccu-base/rootfs-patches/0139-WebUI-Fix-ScriptErrorOnUnknownDatapoint.patchOriginal issue: OpenCCU/OpenCCU#1456
ReGa script variables are shared across the whole script run. The device view in
src/webui/rega/www/pages/tabs/control/hdevichannels.htmiterates over the channels withforeach(tmp, oUser.UserTempViewIDs().EnumIDs()). For datapoints without a specific control,dcCreate()callsCreateUnknown(), which calls::HideCertainParameters()insrc/webui/rega/www/esp/datapointconfigurator.fn. That function also declared and iterated withtmpand overwrote the outer loop variable. As a result, for devices with several channels and such datapoints, only the first channel was shown and ReGaHss logged a script error.This renames the variable in
::HideCertainParameters()totmpHCP. It is not used anywhere else in that function. The file keeps its CRLF line endings.OpenCCU rootfs patches 0039 and 0132 also modify this file and precede 0139 in the series. None of their hunks covers this function, and the line count is unchanged, so both still apply unchanged. The later patches on this file (0143, 0144, 0155) already contain the rename in their workspaces.
Validation
scripts/base-patch-migration.py validatewith the canonical Buildroot 2026.08git4archive of this branch (0a7b164b, sha2566cbb9e540275b21f699839173b18064b8b3b44a0c6abb7de9d97572e9acfacd4) and--skip-patch 0139: PASS (the other 123 rootfs patches apply with zero fuzz).compareagainst the current pin baseline (163ace41, all 124 patches): IDENTICAL (4668 entries).Follow-up cleanup: OpenCCU/OpenCCU#4273