Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch Context State Get, with null or undefined returns all streams? #139

Open
cross311 opened this issue Jun 19, 2020 · 1 comment
Open
Labels
question Further information is requested

Comments

@cross311
Copy link
Collaborator

I want to check that if a null or undefined is passed into ctx.state.get(undefined), does it return all streams? I know this is a feature, but it seems really dangerous. I had an event that i read the stream id off of, and i was worried it might have been null due to getting an OOM error. turns out it was not it, but i want to do my due diligence to make sure if null or undefined gets passed in an error is thrown to remove that as a possibility.

Also the state.get() getting all streams seems dangerous as well, should it not be state.all()? or something more deliberate or easier to find?

@sklose
Copy link
Collaborator

sklose commented Jun 19, 2020

you MUST provide a key to ctx.state.get(...), it will not return all streams if you pass null. there is ctx.state.compute() which optionally takes a key. that one synchronously computes the what-if state if all the events your stored were applied to the base state. it will only do that for states you already loaded in that event handler though.

@plameniv plameniv added the question Further information is requested label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

3 participants