You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(activity): Change to arrow function notation so class context is not lost (#1249)
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR!
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->
<!--- For ALL Contributors 👇 -->
## What was changed
<!-- Describe what has changed in this PR -->
Added missing bindings on activity context class.
## Why?
<!-- Tell your future self why have you made these changes -->
Since we are restoring the `Context` class from `AsyncLocalStorage`.
Class scope is missing and thus rebinding is necessary. Attempting to
use `Context.current().heartbeat()` or `Context.current().sleep()` would
result on `this` property is undefined error.
## Checklist
<!--- add/delete as needed --->
1. Closes <!-- add issue number here -->
2. How was this tested:
<!--- Please describe how you tested your changes/how we can test them
-->
I tested it with the `activities-cancellation-heartbeating` SDK example.
3. Any docs updates needed?
<!--- update README if applicable
or point out where to update docs.temporal.io -->
Since it addresses a current bug, no doc changes are necessary.
0 commit comments