Skip to content

Conversation

@timfish
Copy link
Member

@timfish timfish commented Jun 3, 2025

As reported by @bizob2828,

The AST walker was only instrumenting a function when the sync/async matched the instrumentation. However, this stopped non-async functions that return a promise from being instrumented with tracePromise:

function some() {
  return Promise.resolve(42);
}

Since you can't have multiple functions with the same name, this check is not required.

@timfish timfish requested review from AbhiPrasad and bizob2828 June 3, 2025 19:36
@timfish timfish changed the title fix: Don't check sync/async function types fix: Don't check for matching sync/async function type Jun 4, 2025
@timfish timfish mentioned this pull request Jun 4, 2025
Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(stamp) Looks good to me.

@bizob2828
Copy link
Contributor

code and test updates look good, I'm just going to double check with my work I've been doing

Copy link
Contributor

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this update works with the use case I originally reported

@timfish timfish merged commit 378f9b7 into apm-js-collab:main Jun 4, 2025
1 check passed
@timfish timfish deleted the timfish/fix/dont-enforce-function-types branch September 12, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants