Misleading Documentation: self in fromPromise Refers to Promise Actor, Not Parent

Open
#466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
documentation

Research direction

Start with the linked packages/core/src/actors/promise.ts location and trace how the self parameter is passed to fromPromise's promise. Then find the documentation containing the quoted description and update it only if the implementation confirms the issue's observation. Done means the documentation accurately identifies what self refers to.

Written by the indexing model from the issue text.

Description

In the implementation of fromPromise, a self parameter is passed to the promise when it is executed. The documentation currently describes it as:

"The parent actor of the promise actor"

However, I suspect that self is actually a reference to the newly created promise actor itself.

I'm sending an event to the parent of the fromPromise actor. When I pass:

input: ({ self, context: { foo } }) => ({ foo, parent: self })

…it works as expected.

If the self parameter does indeed refer to the promise actor (not its parent), the documentation should be updated to clarify this.

Code

Dominant language
MDX
Stars
38
Forks
93
Avg merge
19h 31m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from statelyai/docs

All issues in statelyai/docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.