aws / aws/aws-durable-execution-sdk-java
[Feature]: Cross context operation access check
- Dominant language
- Java
- Stars
- 28
- Forks
- 11
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 45
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
Research direction
Start by finding the existing cross-context access check in the TypeScript SDK, then trace the Java operation `.get` path and the thread-local current context ID. Implement equivalent checks for parent, sibling, and other contexts while preserving the stated `parallel` exception, and verify that valid same-context access still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100