hello everyone. I have a question regarding to ory...
# general
f
hello everyone. I have a question regarding to ory kratos hooks and data consistency. say I have a hook to send user info to a server after they successfully signed up, the hook is just an API to save the signed up user info in queue. If the hook failed, the doc said will retry it up to 3 times. so after 3 failures, does register process also failed and user have to do register again? and what happens when hook were to success but instead fail on kratos side? say some transient error happens.
m
Hey @flat-art-3471
If the hook failed, the doc said will retry it up to 3 times. so after 3 failures, does register process also failed and user have to do register again?
I assume you would configure a "before registration" hook. If you configure an "after registraton" hook the registration will always succeed (since the hook fires after it so its not related) For "before registration" hook it depends if you have configured to Ory Action (hook) as non-blocking or not - if it is non-blocking then nothing happens. If it is then the registration fails. I don't really know what you mean by transient error, not sure what would happen then 🤔
f
Lets say we configure after registration hook, so from kratos side, the user already complete their registration flow and user is saved into database successfully. then after registration hook then kick in, but it keep failing and after 3 tries, it stopped, so the webhook service will then fail to receive the user registered hook thus miss that one user data but kratos still stored that user in database since it was registered completed right?
m
Yea that is correct
If you have concerns that data becomes inconsistent, you could periodically fetch all users from Ory Identities/Kratos and compare with your app db
f
@magnificent-energy-493 got it thanks, I think I can use CDC tools like sequin stream or wal-listener to ensure strong consistency instead of webhook in this case