aws / aws/aws-durable-execution-sdk-java
[Feature]: Cross context operation access check
- Dominant language
- Java
- Stars
- 28
- Forks
- 11
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 47
Description
### What would you like?
Add a check to ensure an operation is accessed (calling `.get`) only in the context where it's created.
This would disallow the access to an operation in
- its grandparent context
- its sibling context
- etc
There is an exception - `parallel` operation, in which the branches are always used in its grandparent context.
This check currently exists in TypeScript SDK but not implemented in Java SDK
### Possible Implementation
It's straightforward. The context id of the current thread is in thread local object. We can check that with the operation's context id.
### Is this a breaking change?
#### Yes
### Does this require an RFC?
No
### Additional Context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.