Skip to content

[Feature]: Cross context operation access check #298

@zhongkechen

Description

@zhongkechen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions