Repository navigation
fix(user-transformations): preserve log in cached V1 contexts - #5637
gitcommitshow merged 1 commit into
Conversation
|
👋 I'm rudder-devbox. I opened this PR from a Linear ticket. Mention |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5637 +/- ##
========================================
Coverage 92.11% 92.11%
========================================
Files 708 708
Lines 39529 39530 +1
Branches 9194 9263 +69
========================================
+ Hits 36412 36413 +1
Misses 2932 2932
Partials 185 185 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e4ec74a to
dbeec57
Compare
dbeec57 to
9adbab6
Compare
|
|
Follow-up: root cause is two separate lists of sandbox globals. Fixed in #5675.
#5675 moves the injection into a single |
|
Follow-up: the no-op Outside test mode, #5675 injects the host |



What are the changes introduced in this PR?
Inject the documented
logruntime function when resetting cached V1 isolated-vm contexts. Add focused context-reset coverage and an end-to-end regression proving a Jev-style fail-open branch returns the original event on both cache miss and cache hit.What is the related Linear task?
Resolves MAR-2930
Please explain the objectives of your changes below
Runtime reproduction showed that the first V1 execution succeeds because
ivmFactory.jsdefineslog, but the second execution withUSE_IVM_CACHE=truefailed withReferenceError: log is not definedbecause context reset did not restore it. This change restores parity without changing the broader sandbox architecture.The remaining Jev template findings—including Unicode-safe redaction, identify traits, Bot Management merge semantics, response validation, credential behavior, and upstream byte identity—belong to the dependent
rudder-control-planechange.Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
Cached V1 transformations can now call
log(...)after context reset. In production it remains a non-throwing no-op, matching fresh V1 isolates.Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
The cached-isolate context reset now restores the existing V1
logruntime global alongside the other sandbox APIs.Any technical or performance related pointers to consider with the change?
The injected function is a no-op and is recreated once per reset context. No logging payload is retained or transferred.
Developer checklist
log.Reviewer checklist
Validation
npm run lint— passed.NODE_OPTIONS='--no-node-snapshot' npx jest -c jest.default.config.js test/__tests__/ivmCache/contextReset.test.js test/__tests__/user_transformation.test.js --runInBand --no-coverage— passed.NODE_OPTIONS='--no-node-snapshot' npx jest -c jest.default.config.js test/__tests__/user_transformation.test.js --runInBand -t "keeps log available"— exit 0; 1 focused test passed after reproducingReferenceError: log is not definedon the unmodified runtime.🔭 Live preview
Resumable while this task is open.