ministryofjustice / hmpps-interventions-service

Business/domain interface for providing rehabilitation services to service users
MIT License
1 stars 1 forks source link

Move concluded / withdrawal event to post db update #2020

Closed awhodgson256 closed 1 month ago

awhodgson256 commented 1 month ago

What does this pull request do?

Move notification event(s) to after the updates are applied in R&M

What is the intent behind these changes?

Avoid out of sync notifications when database change in unsuccessful causing issues with NDelius

amolphalnikar commented 1 month ago

Looks good @awhodgson256 . Just wondering if we need to add exception handling block for conclude method call ? If something goes wrong with that, we don't want to publish conclude event.

awhodgson256 commented 1 month ago

Looks good @awhodgson256 . Just wondering if we need to add exception handling block for conclude method call ? If something goes wrong with that, we don't want to publish conclude event.

Hi @amolphalnikar In the event of exception (or a throwable), processing stops and we jump back to exception handling further up the call stack - so in that event we don't get as far as the "signalEnding" method which would send the event. I think we're ok?

amolphalnikar commented 1 month ago

If that's the case then great. Thanks @awhodgson256. I have approved the PR.