cern-sis / issues-inspire

0 stars 0 forks source link

race condition when closing SNow tickets #415

Closed michamos closed 8 months ago

michamos commented 10 months ago

When a user submission gets accepted, we send them an email with the link to the record and close the ticket. This is currently done in two different steps (first adding the message to the ticket then closing with the message The ticket has been closed). The problem is that seems racy on SNow: the user gets the email with the message The ticket has been closed twice as the first email often gets sent after the ticket has already been closed. Example (check activity tab to see the whole history of events): https://cern.service-now.com/nav_to.do?uri=%2Fu_request_fulfillment.do%3Fsys_id%3Dccc2699f479a31508c97ed4c736d43f6.

It might be a bug in SNow (though they're saying we're holding it wrong in the ticket I opened) but it would be better if the ticket closing API call would take a closing message as payload to avoid them being two separate SNow events.

We should probably review the whole API to make sure we're doing things properly.

PascalEgn commented 10 months ago

Tech notes: