fix(eval): preserve sibling params when Filepicker Binary data is passed to action run - #42021
Conversation
…sed to action run (#8639) Passing Filepicker Binary-format data alongside other params to Api.run(), e.g. `Api1.run({ name: "Test", sources: Filepicker1.files })`, caused every sibling param to resolve to null and `this.params` to become null. Root cause: `evaluateActionBindings` serialized the whole params object into a single `{{ ${JSON.stringify(executionParams)} }}` binding and re-parsed it with the brace-counting `getDynamicStringSegments`. Binary file data (a raw readAsBinaryString byte string) routinely contains unescaped '{'/'}' bytes, which `JSON.stringify` does not escape, unbalancing the brace counter and collapsing the entire params object to undefined. Base64/no-file cases worked because their content has no braces. Since `JSON.stringify` emits only literals, that round-trip could only deep-clone the (already fully-evaluated) params — it never resolved nested bindings. Replace it with the already-imported JSON-safe deep clone `klonaJSON`, which is behavior-preserving for valid cases, faithfully passes JS values through, avoids re-serializing multi-MB binary payloads, and removes the brace vulnerability entirely. Tests: add a regression test (unbalanced braces in a param preserve siblings), a behavior-lock test (binding-like string preserved verbatim, NaN survives), and update the getDynamicValue-call assertion to the new single-call-per-binding sequence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Walkthrough
ChangesExecution parameter evaluation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
/build-deploy-preview skip-tests=true |
|
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/29781092349. |
|
Deploy-Preview-URL: https://ce-42021.dp.appsmith.com |
Hacktron Security Check - SkippedReason: Billing required for Code Review seats
|
|
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Description
Filepicker Binary-format data passed alongside other params to
Api.run()caused every sibling param to becomenulland{{this.params}}to becomenull.Reproduce: Filepicker with Data Format = Binary, then
namearrives asnull(andthis.paramsisnull). Base64 format and the no-file case work fine.Root cause:
DataTreeEvaluator.evaluateActionBindingsserialized the whole params object into a single{{ ${JSON.stringify(executionParams)} }}binding and re-parsed it with the brace-countinggetDynamicStringSegments. Filepicker Binary data is a rawreadAsBinaryStringbyte string that routinely contains unescaped{/}bytes;JSON.stringifydoes not escape braces, so the counter unbalances and the entire params object collapses toundefined. Base64 works because its alphabet has no braces.Fix:
JSON.stringifyemits only literals, so that round-trip could only deep-clone the (already fully-evaluated) params — it never resolved nested bindings. Replace it with the already-imported JSON-safe deep cloneklonaJSON(executionParams). This is behavior-preserving for valid cases, faithfully passes JS values through, avoids re-serializing multi-MB binary payloads, and removes the brace vulnerability entirely.Reviewer notes:
undefined/NaN/Dateparam values pass through unnormalized instead of being JSON-coerced.generateOverrideContextalready receives the rawexecutionParamsobject, so its (EE) contract is unchanged.undefinedparams (the exact bug); on the fix allevaluateActionBindingstests pass.TL;DR: Filepicker Binary data in
Api.run()params no longer nulls out the other params — the params object is now deep-cloned instead of round-tripped through the{{ }}binding parser.Fixes https://github.com/appsmithorg/appsmith-ee/issues/8639
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/30824007861
Commit: f7bae03
Cypress dashboard.
Tags:
@tag.AllSpec:
Mon, 03 Aug 2026 15:45:44 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit