-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix bug caused by late nva state store nullification #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense to not purge the state when it wasn’t the state from which the command originated. But why do we need to purge upon persistence at all?
Overall it feels to me like all this machinery has grown out of control. Does it really need to be this complex?
machine-runner/src/runner/runner.ts
Outdated
@@ -859,6 +875,7 @@ namespace NextValueAwaiter { | |||
consume, | |||
peek, | |||
purge, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is no longer used, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. It is no longer used.
emitter.on('next', nva.push) | ||
emitter.on('failure', nva.fail) | ||
emitter.on('commandPersisted', nva.purge) | ||
emitter.on('commandPersisted', purgeWhenMatching) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we do this at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This started when we observed, during one of Jose's presentation on SW's ActyxServiceBase refactor, that a command call should purge so that subsequent .next
/.peekNext
call will not be the same state that calls the command.
As for the specific timing of the purge (on persistence), this is the reasoning #92 (comment)
No description provided.