Skip to content

webui: use a unique loop variable in HideCertainParameters() - #80

Merged
jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0139-webui-hidecertainparameters-tmp
Sep 29, 2026
Merged

jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0139-webui-hidecertainparameters-tmp

Conversation

@jens-maus

@jens-maus jens-maus commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Original OpenCCU rootfs patch: 0139
Original filename: 0139-WebUI-Fix-ScriptErrorOnUnknownDatapoint.patch
Original patch: https://github.com/OpenCCU/OpenCCU/blob/8e9fdb425d208c21ab12636006a8d3e1a2342f15/buildroot-external/package/openccu-base/rootfs-patches/0139-WebUI-Fix-ScriptErrorOnUnknownDatapoint.patch
Original 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.htm iterates over the channels with foreach(tmp, oUser.UserTempViewIDs().EnumIDs()). For datapoints without a specific control, dcCreate() calls CreateUnknown(), which calls ::HideCertainParameters() in src/webui/rega/www/esp/datapointconfigurator.fn. That function also declared and iterated with tmp and 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() to tmpHCP. 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

  • OpenCCU scripts/base-patch-migration.py validate with the canonical Buildroot 2026.08 git4 archive of this branch (0a7b164b, sha256 6cbb9e540275b21f699839173b18064b8b3b44a0c6abb7de9d97572e9acfacd4) and --skip-patch 0139: PASS (the other 123 rootfs patches apply with zero fuzz).
  • compare against the current pin baseline (163ace41, all 124 patches): IDENTICAL (4668 entries).

Follow-up cleanup: OpenCCU/OpenCCU#4273

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.
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 49970951-dd58-43a7-b226-7918af72b2d3

📥 Commits

Reviewing files that changed from the base of the PR and between 163ace4 and 0a7b164.

📒 Files selected for processing (1)
  • src/webui/rega/www/esp/datapointconfigurator.fn

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


📝 Walkthrough

Walkthrough

HideCertainParameters renames its local iteration variable. The exclusion list, hiding condition, and return behavior remain unchanged.

Changes

Parameter filtering

Layer / File(s) Summary
Rename exclusion-list iterator
src/webui/rega/www/esp/datapointconfigurator.fn
The local iteration variable is renamed. The exclusion checks and behavior are unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0a7b1

The rename preserves parameter filtering and avoids the shared-variable collision on the unknown-datapoint path. No material merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 0a7b1

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/webui/rega/www/esp/datapointconfigurator.fn: HideCertainParameters renames the local variable used to iterate over the unchanged exclusion list and compare its entries against each non-system-variable datapoint’s HSSID. The hiding condition and return behavior are unchanged.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: replacing the loop variable in HideCertainParameters() with a unique variable.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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 merged commit 2aee789 into main Sep 29, 2026
5 checks passed
@jens-maus
jens-maus deleted the jens-maus/migrate-0139-webui-hidecertainparameters-tmp branch September 29, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant