-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Description
The user registration workflow triggers the UserRegistered
process manager, which creates a user, creates a team and then adds the user to the team. All three have read model projections. The TeamUser
projection may attempt to project a team user association before the Team
and User
projections have finished, which causes a foreign constraint error.
Steps to Reproduce
Run mix test
for the following files which test the user registration workflow:
test/reply_express_web/controllers/api/v1/users/registration_controller_test.exs
test/reply_express/accounts/users_context_test.exs
test/reply_express/accounts/users_context_test.exs
Recommended Solution
See usage of the error/2
callback on the Elixir Commanded.Projections.Ecto package and Commanded.Event.Handler package. Introduce a retry after delay:
https://hexdocs.pm/commanded_ecto_projections/usage.html#error-handling
https://hexdocs.pm/commanded/Commanded.Event.Handler.html#c:error/3
Metadata
Metadata
Assignees
Labels
Projects
Status
In progress