department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

Check if a confirmation email was previously sent before sending #86428

Closed TaiWilkin closed 2 weeks ago

TaiWilkin commented 4 months ago

We send a confirmation email during the PensionBenefitsIntakeJob. There's no way to 'undo' this step, and we don't have any checks in place to see if the confirmation email was already sent, so this step could get run more than once if the job fails after this step. (It's unlikely the job will fail after this, since all we do afterwards is log the success, but in a worst-case scenario...)

Update Sidekiq job to check whether a confirmation email has been sent for the claim before sending the confirmation email, or otherwise prevent the confirmation email from being able to be sent twice.

One method of doing this might be to use a batch job of some type - see here in Slack.

Recommend beginning by seeing if Sidekick::Batch.new will work: example

aplatt-coforma commented 3 months ago

Hey team! Please add your planning poker estimate with Zenhub @danlim715 @TaiWilkin @wayne-weibel