Commit 199c4ab
fix(eval): preserve sibling params when Filepicker Binary data is passed to action run (#42021)
## Description
Filepicker Binary-format data passed alongside other params to
`Api.run()` caused **every sibling param to become `null`** and
`{{this.params}}` to become `null`.
**Reproduce:** Filepicker with Data Format = Binary, then
```js
await Api1.run({ name: "Test", sources: Filepicker1.files })
```
`name` arrives as `null` (and `this.params` is `null`). Base64 format
and the no-file case work fine.
**Root cause:** `DataTreeEvaluator.evaluateActionBindings` serialized
the whole params object into a single `{{
${JSON.stringify(executionParams)} }}` binding and re-parsed it with the
brace-counting `getDynamicStringSegments`. Filepicker Binary data is a
raw `readAsBinaryString` byte string that routinely contains unescaped
`{`/`}` bytes; `JSON.stringify` does not escape braces, so the counter
unbalances and the **entire** params object collapses to `undefined`.
Base64 works because its alphabet has no braces.
**Fix:** `JSON.stringify` emits 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
clone `klonaJSON(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:**
- Intentional (more-faithful) behavior change now covered by tests:
`undefined`/`NaN`/`Date` param values pass through unnormalized instead
of being JSON-coerced.
- `generateOverrideContext` already receives the raw `executionParams`
object, so its (EE) contract is unchanged.
- Verified red→green: on the old code the regression test returns
all-`undefined` params (the exact bug); on the fix all
`evaluateActionBindings` tests 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 appsmithorg/appsmith-ee#8639
## Automation
/ok-to-test tags="@tag.All"
### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/30824007861>
> Commit: f7bae03
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=30824007861&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Mon, 03 Aug 2026 15:45:44 UTC
<!-- end of auto-generated comment: Cypress test results -->
## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Fixed action parameter evaluation when values contain unbalanced
braces, preserving sibling parameters and correct results.
* Prevented already-evaluated parameters from being altered through
template parsing or type conversion.
* Improved handling of execution parameter references during dynamic
value evaluation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent ec663b7 commit 199c4ab
2 files changed
Lines changed: 63 additions & 35 deletions
Lines changed: 58 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
163 | 198 | | |
164 | 199 | | |
165 | 200 | | |
| |||
242 | 277 | | |
243 | 278 | | |
244 | 279 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
253 | 289 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
275 | 304 | | |
276 | 305 | | |
277 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2069 | 2069 | | |
2070 | 2070 | | |
2071 | 2071 | | |
2072 | | - | |
2073 | | - | |
2074 | | - | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
2078 | 2077 | | |
2079 | 2078 | | |
2080 | 2079 | | |
| |||
0 commit comments