aws / aws/aws-durable-execution-sdk-java

[Feature]: Cross context operation access check

Open
#298 1 comment 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.