Skip to content

fix(instrumentations): preserve asyncEnd wait with code-transformer 0.16#9256

Merged
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-07-08-code-transformer-async-end
Jul 8, 2026
Merged

fix(instrumentations): preserve asyncEnd wait with code-transformer 0.16#9256
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-07-08-code-transformer-async-end

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Code-transformer 0.16 changes the generated native-Promise fulfillment handler to return __apm$ctx.result instead of the local result. waitForAsyncEnd located the return by matching an identifier named result, so on 0.16 it stops matching and silently skips injecting the asyncEndPromise wait — the Playwright RUM Page.goto tagging that depends on it then misses tags when a page closes immediately, and the should wait for an asyncEnd promise when configured rewriter spec fails.

  1. waitForAsyncEnd now reuses the fulfillment handler's actual return argument instead of a hard-coded result identifier, so it keeps injecting across the shape change and resolves to the value a subscriber may reassign on __apm$ctx.result in asyncEnd.
  2. Bump the vendored @apm-js-collab/code-transformer from 0.15.0 to 0.16.0.

Refs: nodejs/orchestrion-js#85

Code-transformer 0.16 changes the generated native-Promise fulfillment
handler to return `__apm$ctx.result` instead of the local `result`, so
`waitForAsyncEnd` — which located the return by matching an identifier
named `result` — stopped matching and silently skipped injecting the
`asyncEndPromise` wait. Playwright RUM `Page.goto` tagging that relies on
that wait would then miss tags when a page closes immediately.

The transform now reuses the fulfillment handler's actual return
argument, so it keeps injecting across the shape change and resolves to
the value a subscriber may reassign on `__apm$ctx.result` in `asyncEnd`.

Bump the vendored @apm-js-collab/code-transformer from 0.15.0 to 0.16.0.

Refs: nodejs/orchestrion-js#85
@dd-octo-sts

dd-octo-sts Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.65 MB
Deduped: 7.31 MB
No deduping: 7.31 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 437.94 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jul 8, 2026

Copy link
Copy Markdown

Tests

Fix all issues with BitsAI

⚠️ Warnings

🧪 1 Test failed in 1 job

All Green | all-green   GitHub Actions

esm with oracledb >=5 (6.10.0) is instrumented star from with oracledb >=5 (6.10.0)   View in Datadog
Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/dd-trace-js/dd-trace-js/packages/datadog-plugin-oracledb/test/integration-test/client.spec.js)

Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/work/dd-trace-js/dd-trace-js/packages/datadog-plugin-oracledb/test/integration-test/client.spec.js)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 96.50% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b0cbedc | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jul 8, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-08 10:28:42

Comparing candidate commit b0cbedc in PR branch BridgeAR/2026-07-08-code-transformer-async-end with baseline commit a619775 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2305 metrics, 53 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-210.085ms; +202.232ms] or [-7.890%; +7.595%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-230.253ms; +238.523ms] or [-9.068%; +9.394%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-162.934ms; +158.437ms] or [-5.273%; +5.127%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-189357.302µs; +187690.935µs] or [-6.503%; +6.446%]

scenario:appsec-control-20

  • unstable execution_time [-120.600ms; +132.714ms] or [-7.369%; +8.109%]

scenario:appsec-control-24

  • unstable execution_time [-98.927ms; +124.560ms] or [-8.083%; +10.178%]

scenario:appsec-control-26

  • unstable execution_time [-123.219ms; +120.896ms] or [-10.017%; +9.828%]

scenario:appsec-iast-no-vulnerability-control-20

  • unstable execution_time [-15.323ms; +12.965ms] or [-5.872%; +4.968%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-11.063ms; +17.225ms] or [-4.312%; +6.713%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable execution_time [-11.215ms; +16.611ms] or [-4.430%; +6.562%]

scenario:appsec-iast-with-vulnerability-control-20

  • unstable execution_time [-29320.751µs; +28822.884µs] or [-5.287%; +5.198%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-3349.014ms; +2269.864ms] or [-35.134%; +23.813%]
  • unstable execution_time [-3376.173ms; +2289.828ms] or [-32.910%; +22.321%]
  • unstable instructions [-28.5G instructions; +19.1G instructions] or [-36.333%; +24.430%]
  • unstable max_rss_usage [-14.144MB; +9.274MB] or [-8.716%; +5.715%]
  • unstable throughput [-620.758op/s; +884.440op/s] or [-18.734%; +26.691%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-3257.454ms; +2883.687ms] or [-32.054%; +28.376%]
  • unstable execution_time [-3375.388ms; +2996.030ms] or [-30.973%; +27.492%]
  • unstable instructions [-28.2G instructions; +25.4G instructions] or [-33.208%; +29.841%]
  • unstable max_rss_usage [-9922.093KB; +9306.093KB] or [-6.149%; +5.767%]
  • unstable throughput [-636.621op/s; +704.306op/s] or [-20.545%; +22.730%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1874.100ms; +654.283ms] or [-22.213%; +7.755%]
  • unstable execution_time [-1883.053ms; +677.450ms] or [-20.615%; +7.416%]
  • unstable instructions [-16.3G instructions; +5.5G instructions] or [-23.575%; +8.031%]
  • unstable throughput [-188.910op/s; +466.422op/s] or [-5.211%; +12.866%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-2.678s; +5.745s] or [-25.918%; +55.605%]
  • unstable execution_time [-2.637s; +5.761s] or [-23.814%; +52.039%]
  • unstable instructions [-23.7G instructions; +51.3G instructions] or [-27.446%; +59.294%]
  • unstable max_rss_usage [-8.362MB; +18.179MB] or [-5.167%; +11.232%]
  • unstable throughput [-1127.491op/s; +511.231op/s] or [-36.768%; +16.672%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-1485.980ms; +521.492ms] or [-17.864%; +6.269%]
  • unstable execution_time [-1498.411ms; +517.869ms] or [-16.596%; +5.736%]
  • unstable instructions [-12.8G instructions; +4.2G instructions] or [-18.791%; +6.203%]
  • unstable throughput [-165.462op/s; +443.861op/s] or [-4.567%; +12.252%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-1843.219ms; +596.394ms] or [-19.706%; +6.376%]
  • unstable execution_time [-1844.966ms; +635.031ms] or [-18.313%; +6.303%]
  • unstable instructions [-16.2G instructions; +5.2G instructions] or [-20.695%; +6.602%]
  • unstable throughput [-146.438op/s; +404.477op/s] or [-4.492%; +12.409%]

scenario:dogstatsd-aggregated-20

  • unstable execution_time [-98.226ms; +62.231ms] or [-7.566%; +4.793%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-353.975ms; +365.358ms] or [-7.373%; +7.610%]
  • unstable execution_time [-360031.591µs; +360459.674µs] or [-7.376%; +7.385%]
  • unstable throughput [-122725.317op/s; +123831.357op/s] or [-7.132%; +7.197%]

scenario:fs-subscribed-24

  • unstable execution_time [-18.198ms; +27.540ms] or [-4.536%; +6.865%]

scenario:plugin-claude-agent-sdk-compact-stream-scan-26

  • unstable cpu_usage_percentage [-7.171%; +4.061%]

scenario:plugin-graphql-long-with-depth-off-20

  • unstable max_rss_usage [-4.118MB; +10.366MB] or [-3.181%; +8.008%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-744.421ms; +729.111ms] or [-5.800%; +5.681%]
  • unstable execution_time [-743.050ms; +736.677ms] or [-5.666%; +5.617%]
  • unstable throughput [-3.411op/s; +3.438op/s] or [-5.556%; +5.600%]

scenario:plugin-pg-service-26

  • unstable cpu_usage_percentage [-5.834%; +6.259%]
  • unstable execution_time [-87.548ms; +59.205ms] or [-9.533%; +6.447%]
  • unstable throughput [-322617.113op/s; +537284.864op/s] or [-4.856%; +8.087%]

scenario:sampling-rate-limited-20

  • unstable execution_time [-51.973ms; +91.546ms] or [-3.662%; +6.451%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-5305.675KB; +6996.008KB] or [-6.482%; +8.547%]

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.12%. Comparing base (a619775) to head (b0cbedc).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9256      +/-   ##
==========================================
- Coverage   96.54%   96.12%   -0.43%     
==========================================
  Files         915      915              
  Lines      121018   121032      +14     
  Branches    20693    20931     +238     
==========================================
- Hits       116837   116342     -495     
- Misses       4181     4690     +509     
Flag Coverage Δ
aiguard 53.56% <21.05%> (-0.06%) ⬇️
aiguard-integration 57.00% <21.05%> (-0.01%) ⬇️
apm-bucket-0 53.79% <21.05%> (-0.06%) ⬇️
apm-bucket-1 58.09% <21.05%> (-0.07%) ⬇️
apm-bucket-2 56.11% <21.05%> (-0.06%) ⬇️
apm-capabilities-tracing 60.26% <21.05%> (-0.04%) ⬇️
apm-integrations-aerospike 52.94% <21.05%> (-0.06%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.07% <21.05%> (+<0.01%) ⬆️
apm-integrations-couchbase 53.26% <21.05%> (-0.06%) ⬇️
apm-integrations-http 57.98% <21.05%> (-0.05%) ⬇️
apm-integrations-kafkajs 57.72% <21.05%> (-0.08%) ⬇️
apm-integrations-next 54.24% <21.05%> (-0.06%) ⬇️
apm-integrations-prisma 54.18% <21.05%> (-0.06%) ⬇️
apm-integrations-tedious 53.04% <21.05%> (-0.06%) ⬇️
appsec 69.03% <21.05%> (-0.11%) ⬇️
appsec-express_fastify_graphql 65.69% <21.05%> (-0.06%) ⬇️
appsec-integration 45.50% <21.05%> (-0.01%) ⬇️
appsec-kafka_ldapjs_lodash 59.12% <21.05%> (-0.05%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.28% <21.05%> (-0.05%) ⬇️
appsec-next 52.86% <21.05%> (-0.05%) ⬇️
appsec-node-serialize_passport_postgres 61.92% <21.05%> (-0.05%) ⬇️
appsec-sourcing_stripe_template 60.25% <21.05%> (-0.07%) ⬇️
debugger 65.69% <21.05%> (-0.04%) ⬇️
instrumentations-bucket-0 48.75% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-1 54.97% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-10 56.64% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-11 48.74% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-12 48.84% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-13 48.67% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-2 49.73% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-3 53.83% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-4 49.16% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-5 53.01% <21.05%> (-0.05%) ⬇️
instrumentations-bucket-6 55.62% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-7 53.60% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-8 54.64% <21.05%> (-0.06%) ⬇️
instrumentations-bucket-9 56.10% <21.05%> (-0.05%) ⬇️
instrumentations-instrumentation-couchbase 48.17% <21.05%> (-0.06%) ⬇️
instrumentations-integration-esbuild 33.90% <21.05%> (-0.01%) ⬇️
llmobs-ai_anthropic_bedrock 57.75% <21.05%> (-0.05%) ⬇️
llmobs-bucket-1 56.81% <21.05%> (-0.05%) ⬇️
llmobs-openai 57.58% <21.05%> (-0.05%) ⬇️
llmobs-sdk 59.98% <21.05%> (-0.06%) ⬇️
llmobs-vertex-ai 54.22% <21.05%> (-0.06%) ⬇️
master-coverage 96.12% <100.00%> (?)
openfeature 54.60% <21.05%> (-0.02%) ⬇️
openfeature-unit 49.82% <21.05%> (-0.06%) ⬇️
platform-core_esbuild_instrumentations-misc 38.40% <100.00%> (-0.02%) ⬇️
platform-integration 62.18% <21.05%> (-0.02%) ⬇️
platform-shimmer_unit-guardrails_webpack 37.19% <21.05%> (-0.03%) ⬇️
plugins-bucket-0 53.18% <21.05%> (-0.05%) ⬇️
plugins-bucket-1 55.07% <21.05%> (-0.02%) ⬇️
plugins-bucket-11 56.73% <21.05%> (-0.06%) ⬇️
plugins-bucket-17 56.75% <21.05%> (-0.06%) ⬇️
plugins-bucket-18 57.60% <21.05%> (-0.06%) ⬇️
plugins-bucket-19 57.13% <21.05%> (-0.06%) ⬇️
plugins-bucket-20 59.36% <21.05%> (-0.08%) ⬇️
plugins-bucket-4 53.85% <21.05%> (-0.06%) ⬇️
plugins-bullmq_cassandra_cookie 57.40% <21.05%> (-0.06%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.32% <21.05%> (-0.06%) ⬇️
plugins-fetch_fs_generic-pool 54.54% <21.05%> (-0.06%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 59.88% <21.05%> (-0.06%) ⬇️
plugins-hapi_hono_ioredis 55.87% <21.05%> (-0.06%) ⬇️
plugins-jest_knex_langgraph 51.66% <21.05%> (-0.06%) ⬇️
plugins-ldapjs_light-my-request_limitd-client ?
plugins-lodash_mariadb_memcached 54.21% <21.05%> (-0.06%) ⬇️
plugins-mongodb_mongodb-core_mongoose ?
plugins-multer_mysql_mysql2 54.37% <21.05%> (-0.06%) ⬇️
plugins-nats_node-serialize_opensearch 56.07% <21.05%> (-0.06%) ⬇️
plugins-passport-http_pino_postgres 54.75% <21.05%> (-0.06%) ⬇️
plugins-process_pug_redis 53.87% <21.05%> (-0.07%) ⬇️
plugins-undici_url_valkey 54.30% <21.05%> (-0.14%) ⬇️
plugins-vm_winston_ws 55.27% <21.05%> (-0.06%) ⬇️
profiling 58.21% <21.05%> (-0.06%) ⬇️
serverless-aws-sdk-aws-sdk ?
serverless-aws-sdk-bedrockruntime 50.68% <21.05%> (-0.05%) ⬇️
serverless-aws-sdk-client 51.95% <21.05%> (-0.06%) ⬇️
serverless-aws-sdk-dynamodb 51.75% <21.05%> (-0.05%) ⬇️
serverless-aws-sdk-eventbridge 46.22% <21.05%> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.70% <21.05%> (-0.06%) ⬇️
serverless-aws-sdk-lambda 52.78% <21.05%> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.52% <21.05%> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.73% <21.05%> (-0.06%) ⬇️
serverless-aws-sdk-sns 55.48% <21.05%> (-0.06%) ⬇️
serverless-aws-sdk-sqs 55.91% <21.05%> (-0.06%) ⬇️
serverless-aws-sdk-stepfunctions 51.25% <21.05%> (-0.05%) ⬇️
serverless-aws-sdk-util 48.45% <21.05%> (-0.06%) ⬇️
serverless-bucket-0 55.23% <21.05%> (-0.02%) ⬇️
serverless-bucket-1 56.01% <21.05%> (-0.06%) ⬇️
test-optimization-cucumber 72.93% <21.05%> (-0.05%) ⬇️
test-optimization-cypress 66.45% <21.05%> (+0.06%) ⬆️
test-optimization-jest 73.89% <21.05%> (-0.06%) ⬇️
test-optimization-mocha 74.31% <21.05%> (+0.03%) ⬆️
test-optimization-playwright-playwright-atr 61.60% <100.00%> (+<0.01%) ⬆️
test-optimization-playwright-playwright-efd 61.79% <100.00%> (+0.01%) ⬆️
test-optimization-playwright-playwright-final-status 61.74% <100.00%> (+<0.01%) ⬆️
test-optimization-playwright-playwright-impacted-tests 61.47% <100.00%> (+0.17%) ⬆️
test-optimization-playwright-playwright-reporting 61.37% <100.00%> (-0.19%) ⬇️
test-optimization-playwright-playwright-test-management 62.28% <100.00%> (-0.11%) ⬇️
test-optimization-playwright-playwright-test-span 61.50% <100.00%> (-0.06%) ⬇️
test-optimization-selenium 60.69% <21.05%> (-0.18%) ⬇️
test-optimization-testopt 59.16% <100.00%> (+0.09%) ⬆️
test-optimization-vitest 72.75% <21.05%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

BridgeAR added 2 commits July 8, 2026 12:10
Keep the `findIndex` result instead of re-scanning `statements` with
`indexOf` for the same node, and deep-clone the reused return argument
with the vendored `rfdc` (the repo's standard clone) rather than
`structuredClone`.
…ling

The `tracePromise` fulfillment handler the transform splices into always
ends in a value-returning statement, so the early-return-on-miss branch
was unreachable defensive code the tests could not exercise. Assert the
invariant instead: a miss can only mean the upstream code-transformer
template changed, and the assertion surfaces that loudly through the
caller's try/catch (which falls back to the unwrapped source) rather than
throwing an opaque TypeError from the splice.
@BridgeAR
BridgeAR marked this pull request as ready for review July 8, 2026 10:18
@BridgeAR
BridgeAR requested a review from a team as a code owner July 8, 2026 10:18
@BridgeAR
BridgeAR requested review from bojbrook and removed request for a team July 8, 2026 10:18
@BridgeAR
BridgeAR merged commit dc579ef into master Jul 8, 2026
803 of 805 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-07-08-code-transformer-async-end branch July 8, 2026 11:42
This was referenced Jul 9, 2026
juan-fernandez pushed a commit that referenced this pull request Jul 10, 2026
….16 (#9256)

Code-transformer 0.16 changes the generated native-Promise fulfillment
handler to return `__apm$ctx.result` instead of the local `result`, so
`waitForAsyncEnd` — which located the return by matching an identifier
named `result` — stopped matching and silently skipped injecting the
`asyncEndPromise` wait. Playwright RUM `Page.goto` tagging that relies on
that wait would then miss tags when a page closes immediately.

The transform now reuses the fulfillment handler's actual return
argument, so it keeps injecting across the shape change and resolves to
the value a subscriber may reassign on `__apm$ctx.result` in `asyncEnd`.

Bump the vendored @apm-js-collab/code-transformer from 0.15.0 to 0.16.0.

Refs: nodejs/orchestrion-js#85
juan-fernandez pushed a commit that referenced this pull request Jul 10, 2026
….16 (#9256)

Code-transformer 0.16 changes the generated native-Promise fulfillment
handler to return `__apm$ctx.result` instead of the local `result`, so
`waitForAsyncEnd` — which located the return by matching an identifier
named `result` — stopped matching and silently skipped injecting the
`asyncEndPromise` wait. Playwright RUM `Page.goto` tagging that relies on
that wait would then miss tags when a page closes immediately.

The transform now reuses the fulfillment handler's actual return
argument, so it keeps injecting across the shape change and resolves to
the value a subscriber may reassign on `__apm$ctx.result` in `asyncEnd`.

Bump the vendored @apm-js-collab/code-transformer from 0.15.0 to 0.16.0.

Refs: nodejs/orchestrion-js#85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants