Skip to content

Conversation

jeffrifwaldsmartcontract
Copy link
Contributor

@jeffrifwaldsmartcontract jeffrifwaldsmartcontract commented Sep 18, 2025

I'm currently coming up with an explaination as to why using await vs .then makes everything suddenly work. It could be an issue with throwing errors in the then callback, but I'll try to pin down the actual issue.

It looks like this is where calling callCabability.then fails for some reason:

https://github.com/smartcontractkit/cre-sdk-typescript/blob/main/src/sdk/utils/lazy-promise.ts#L44

I get stuck at this.factory() and it never progresses. It doesn't throw an error either. I'm still not sure why using await fixes the issue.

}
const capabilityId = BasicCapability.CAPABILITY_ID

return callCapability({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A possible issue here is returning the .then result in an async function.

@ernest-nowacki ernest-nowacki merged commit dfaa780 into main Sep 19, 2025
8 checks passed
@ernest-nowacki ernest-nowacki deleted the fix/async-actions branch September 19, 2025 10:28
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.

2 participants