Given I have a user without an external auth
When the user logs in to the external auth
Then the event is sent before the query was committed to the database
If an app is listening for the events and does a GET on the external auth when it received the event, a 404 is returned. A bit after, the request returns the right result.
Does it happen in the same HTTP request? (sending event + reading this event)
Or it has a lot a treatment between sending the event and commit database?
Note: in wazo-confd we send event after committing in the DB
It’s not the same HTTP request. The external auth is created on a POST and it’s the POST that emits the event. When an app receives the event and does a GET on the external auth, if it’s too fast it gets a 404