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

Add failing test with synchronous event sourced saga #112

Merged
merged 4 commits into from
Jun 4, 2023

Conversation

jlabedo
Copy link
Contributor

@jlabedo jlabedo commented May 4, 2023

Test to reproduce #104

The test is failing because the SagaProjection is not initialized. In fact, the event handler is executed as a "normal" event handler and not in the context of a "projection" handler

@dgafka
Copy link
Member

dgafka commented May 5, 2023

Amazing :)

How important is this for you? From what I understood in the issue, you changed the flow, so no hurry with this one?

@jlabedo
Copy link
Contributor Author

jlabedo commented May 5, 2023

We corrected the flow in one case, but we found it in another case, fixed it, and then back again after a refactoring, making the synchronous flow pretty unusable. Pretty hard to debug as we receive only a postgres "duplicate key error" from our projection (first insert executed outside of a projection context is passing, while the execution inside the projection context comes after and is failing)

@dgafka
Copy link
Member

dgafka commented May 5, 2023

Hey @unixslayer :)
Will you find time to take a look on this?

@unixslayer
Copy link
Member

Hey @unixslayer :)
Will you find time to take a look on this?

Sure. I'll find some time after this weekend.

@dgafka
Copy link
Member

dgafka commented May 6, 2023

Great thanks @unixslayer :)

@unixslayer
Copy link
Member

👀

@unixslayer
Copy link
Member

Model fails in two different circumstances and setups.

In Behat test, initialization of SagaProjection is not triggered even it is configured and registered correctly. Although, I've noticed that BasketWasCreated gets handled twice: first time after it is recorded and second time when Saga is done which leasd to resetting basket and removing product in read model.

I've also written unit test using Ecotone Test Support and it shows that basket projection is not handling ProductWasAddedToBasket after Saga finish. However, here SagaProjection is initialized properly.

@jlabedo if you grant me access to your fork I can push additional commit with changes I've made.

@jlabedo
Copy link
Contributor Author

jlabedo commented May 23, 2023

Hello @unixslayer , i gave you access to my repository, thanks!

} else {
$namedEventHandlers[$chanelName][] = $chanelName;
$namedEventHandlers[$chanelName] = array_unique($namedEventHandlers[$chanelName]);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is small improved to avoid registering event handler by class name routing by name, if not defined explicitly.

@dgafka dgafka merged commit f640b60 into ecotoneframework:main Jun 4, 2023
@dgafka
Copy link
Member

dgafka commented Jun 4, 2023

@jlabedo @unixslayer This is solved by #139 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants