Repository navigation
fix(test): hoist inline closures in RateLimiterSpec to fix Adobe CF crash (#2568) - #2599
Conversation
There was a problem hiding this comment.
Wheels Bot — Reviewer A
TL;DR: This PR correctly fixes the Adobe CF ASTcffunction ArrayStoreException crash by hoisting all 12 inline keyFunction = function(...) literals in RateLimiterSpec.cfc out of the new wheels.middleware.RateLimiter(...) constructor calls, and adds accurate cross-engine documentation. The fix is mechanically sound and Lucee/BoxLang-safe. Two issues block merge: a missing DCO Signed-off-by: trailer in the commit (required CI status check) and a missing CHANGELOG.md entry required by the PR template. One minor nit about inline comment placement.
Correctness
No issues. All 12 keyFunction sites now pass a pre-declared var keyFn reference instead of an inline literal, matching the precedent already set in SessionStrategySpec.cfc. A grep of the final file confirms zero remaining keyFunction = function( patterns. The documentation additions in .ai/wheels/cross-engine-compatibility.md (lines 67–88) and CLAUDE.md are accurate and well-placed — the why/how/reference examples are all present.
Conventions
Nit — comment present on only one of 12 hoisted sites.
vendor/wheels/tests/specs/middleware/RateLimiterSpec.cfc, lines 491–492 (added):
// Adobe CF: hoist the function literal out of `new` to dodge
// ASTcffunction ArrayStoreException at compile time.
var keyFn = function(req) { return longKey; };The other 11 hoisted sites are uncommented. Since the pattern is now documented globally in .ai/wheels/cross-engine-compatibility.md and CLAUDE.md, the inline comment is not strictly required — and inconsistently applying it to only one site is mildly confusing. Suggestion: either remove the inline comment entirely (the docs are the canonical reference) or add a single file-level comment near the top of the relevant describe block covering all sites. Not blocking.
Commits
Blocking — DCO Signed-off-by: trailer is absent.
git show 67248c47fd22a8ef3a0f4771e2dbbd0e41aca931 --format="%B" | grep "Signed-off-by"
→ (empty)
The commit ends with Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> but carries no Signed-off-by: Peter Amiri <peter@alurium.com> trailer. Per CONTRIBUTING.md § DCO and the PR template checklist item 1, every commit must carry this trailer. The DCO GitHub App is a required status check and will block merge. Fix with:
git commit --amend -s # appends Signed-off-by automatically from git config
git push --force-with-leaseThe rest of the commit message is well-formed: type fix, scope test, subject ≤ 100 chars, not ALL-CAPS, body explains the why clearly.
Docs
Minor — no CHANGELOG.md entry under [Unreleased].
The PR template (.github/pull_request_template.md, line 26) requires a CHANGELOG entry for every PR. Fixing a crash on adobe2023/adobe2025 that caused every database to return HTTP 500 on those engines is notable enough to warrant a Fixed entry, even though it is test-only. Suggested addition under the Fixed subsection of [Unreleased]:
- Fix Adobe CF `ASTcffunction ArrayStoreException` crash in `RateLimiterSpec` caused by
inline function literals as named constructor arguments; hoist pattern now documented in
cross-engine compatibility guide (#2568, #2599)The PR description also replaced the standard template checkboxes (DCO, Tests, AI Ref Docs, CLAUDE.md, CHANGELOG, test runner) with a freeform summary, making completeness harder to verify at a glance.
67248c4 to
b74577d
Compare
|
@wheels-bot — addressing the three items. 1. DCO sign-off (blocking) — fixed. Amended via 2. CHANGELOG.md entry (minor) — added. Entry placed at the top of 3. PR description template — updated. Reformatted to follow 4. Inline comment nit — keeping as-is. The comment at line 491–492 matches the precedent in commit |
Wheels Bot — Reviewer B (round 1)A's review is sound. The DCO finding is confirmed, the correctness claims hold up against the diff, and the nit about comment inconsistency is accurate. One minor overstatement on the CHANGELOG requirement, no false positives on the code itself, and no missed issues. SycophancyNone detected. Every claim in the Correctness section is backed by diff evidence. The 12-site count is accurate. False positivesMinor — CHANGELOG requirement overstated. A cites the PR template's checklist as requiring a CHANGELOG entry, but the checklist header reads "All items must be checked for new features and enhancements." This is a bug-fix PR, not a feature or enhancement. The CHANGELOG requirement as stated is not strictly mandatory per the template. That said, the No false positives on the code claims. A grep of other spec files confirms no remaining Missed issuesNone detected. All 12 hoisted sites are in RateLimiterSpec.cfc. SessionStrategySpec.cfc was already clean. No other affected files exist. Verdict alignmentCHANGES_REQUESTED is correct. The DCO ConvergenceAligned. A's CHANGES_REQUESTED verdict stands: the DCO fix is the hard blocker (contributor needs to amend and force-push), a CHANGELOG entry under |
… ASTcffunction (#2568) Adobe CF's bytecode generator crashes with `java.lang.ArrayStoreException: coldfusion.compiler.ASTcffunction` when a function literal is passed as a named argument to a `new Component(...)` call. The error fires from `getComponentMetadata()` in TestBox, and because Adobe CF eagerly compiles every CFC in the bundle directory before running, the failure crashes the *entire* core test suite — every database (mysql/postgres/sqlserver/oracle/ cockroachdb/sqlite) returns HTTP 500 on adobe2023 and adobe2025. This is the same workaround already applied in SessionStrategySpec. The fix is mechanical: hoist each `keyFunction = function(req) { ... }` out of the constructor call into a `var keyFn = ...;` declaration above the `new wheels.middleware.RateLimiter(...)` call, then pass the reference. 12 sites updated. No behavior change on Lucee or BoxLang — they compile both forms identically. Also documents the trap in `.ai/wheels/cross-engine-compatibility.md` and the CLAUDE.md "Known cross-engine gotchas" list so future agents catch it before re-introducing it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
b74577d to
0b02598
Compare
|
Merge conflict resolved. #2597 landed on develop just before my rebase and also added an entry to
Re Reviewer B: noted the CHANGELOG-requirement framing was overstated (template scope is "new features and enhancements"), but since this bug took down both Adobe CF engines across all databases — the pragmatic-addition case B describes — keeping the entry. No code-level disagreement. |
Wheels Bot — Address Review (round 1)The converged-changes consensus from Reviewer A and Reviewer B was reached at the prior SHA Consensus items — current state at
|
There was a problem hiding this comment.
Wheels Bot — Reviewer A
TL;DR: This PR addresses the blocking issues identified in the previous review (SHA 67248c47): the DCO Signed-off-by trailer is now present, the CHANGELOG.md entry was added, and the CLAUDE.md and .ai/ docs are updated. The surgical fix — hoisting all 12 inline keyFunction = function(...) closures out of new wheels.middleware.RateLimiter(...) constructor calls — is mechanically complete, no inline patterns remain, and the change is safe across all engines. This PR is ready to merge pending CI green on adobe2023/adobe2025.
Correctness
All 12 inline keyFunction = function(...) patterns inside new constructor calls have been hoisted. A search of the final file confirms zero remaining keyFunction = function( instances (all twelve sites now use a pre-declared var keyFn = ...;). The pattern exactly matches the existing workaround already applied in SessionStrategySpec.cfc. No functional change to the rate-limiter behavior; Lucee and BoxLang compile both forms identically.
The one site that was commented previously (vendor/wheels/tests/specs/middleware/RateLimiterSpec.cfc, line 491) retains its comment and all other sites are uncommented — since the pattern is now globally documented in .ai/wheels/cross-engine-compatibility.md and CLAUDE.md, this is acceptable. No issue.
Cross-engine
No new cross-engine concerns introduced. The fix is specifically targeted at Adobe CF's ExprAssembler.invokeNew bytecode-generator crash. Documentation in .ai/wheels/cross-engine-compatibility.md (lines 67–88) is accurate and placed logically between the bracket-notation and array-by-value sections. CLAUDE.md "Known cross-engine gotchas" entry is concise and actionable.
Commits
DCO resolved. The commit now carries:
Signed-off-by: Peter Amiri <peter@alurium.com>
Commit message conforms to commitlint.config.js: type fix, scope test, subject "hoist inline closures in RateLimiterSpec to dodge Adobe CF ASTcffunction (#2568)" is 91 characters (within the 100-char cap), not ALL-CAPS. Body explains the why clearly.
Docs
CHANGELOG.md entry is present under [Unreleased] → Fixed (line 157). The entry is detailed — arguably verbose for a changelog — but accurate and helpful for anyone bisecting the Adobe CF failure history. No objection.
.ai/wheels/cross-engine-compatibility.md and CLAUDE.md both updated with the WRONG/RIGHT pattern and the ExprAssembler rationale. These prevent re-introduction of the bug by future agents or contributors.
Wheels Bot - Reviewer B (round 1)A's review is accurate and complete on this SHA. The code claims check out, the 12-site count is verified against the diff, and the documentation updates are correct. One process-level note on verdict state; no code-level disagreements. SycophancyNone detected. A's TL;DR is backed by evidence - the 12 hoisted sites are enumerable in the diff, the DCO trailer is confirmed in the commit, and the docs entries are quoted with line references. False positivesNone detected. All claims hold against the diff:
Missed issuesVerdict state vs. recommendation mismatch. A submitted the review with state No other missed issues. No remaining inline patterns in the spec file, no cross-engine concerns introduced, no test coverage gaps (the spec tests are the fix). Verdict alignmentBorderline. The substance of A's review supports an approve verdict; the submitted state ( ConvergenceAligned. A's code-level findings are correct and complete. The PR is clean: DCO fixed, CHANGELOG added, 12 sites hoisted, docs updated, nit declined on the record. The only open item is CI green on |
Summary
Resolves #2568 — core test suite crashes on Adobe ColdFusion 2023/2025 with
java.lang.ArrayStoreException: coldfusion.compiler.ASTcffunction. Every database matrix cell (mysql/postgres/sqlserver/cockroachdb/oracle/sqlite) onadobe2023andadobe2025has returned HTTP 500 for the last 5+ weekly compat-matrix runs.Root cause:
vendor/wheels/tests/specs/middleware/RateLimiterSpec.cfcpassed 12 inlinekeyFunction = function(req) { ... }literals as named arguments tonew wheels.middleware.RateLimiter(...). Adobe CF's bytecode generator (ExprAssembler.invokeNew→generateSetVarCode→assignStatement) rejects function-AST nodes in that array slot. The failure fires fromgetComponentMetadata()in TestBox, and because Adobe CF eagerly compiles every CFC in the bundle directory before running, one bad spec crashes the entire core test suite for that engine.Fix: Hoist all 12 inline closures into
var keyFn = ...;declarations above thenewcall. Matches the existing workaround inSessionStrategySpec.cfc. Identical to the unmerged May 3 commit (2c329d4cbon the abandoned branchclaude/loving-chaplygin-fa1988) — this PR cherry-picks just the surgical RateLimiterSpec portion and adds documentation so the trap doesn't recur.Related Issue
Closes #2568
Type of Change
Feature Completeness Checklist
Signed-off-by: Peter Amiri <peter@alurium.com>.ai/wheels/cross-engine-compatibility.mddocumenting the trap with WRONG/RIGHT examples and theExprAssemblerwhy[Unreleased]→FixedTest Plan
adobe2023+adobe2025across all databases — direct verification this fix resolves the reported errorcoldfusion.compiler.ASTcffunctionerror in TestBox metadata loading #2568 reporter (zainforbjs) can verify Adobe CF test runs no longer crash🤖 Generated with Claude Code