reapit / foundations

Foundations platform mono repo
57 stars 21 forks source link

Why is it possible to create duplicated tenancy check? #11184

Open abrahamseni opened 3 months ago

abrahamseni commented 3 months ago

I am able to create more than one tenancy check with the same checkTypeId. Is this intended?

The context is this tenancy ID - WNL240036 (env: SAV) created duplicate checks on May 17. We are still investigating it, but this has never happened before. Looking at the created timestamp, it only differs about 2-3 seconds. Do you have any idea what is happening?

Screenshot 2024-06-04 040209

Thanks.

Specification

plittlewood-rpt commented 2 months ago

Hi @abrahamseni I've had a look at our logs and there was a really high volume of calls related to tenancy checks for this tenancy on 17th May (384 between 10.23 and 13:46). It looks like two users were looking at tenancy checks for this tenancy on the app at exactly the same time (let me know if you need to know who the users were). It's likely that different instances of the API handled requests from each user, and a race condition may have occurred where both instances thought that the checks didn't exist, so both created them.

abrahamseni commented 2 months ago

Thanks @plittlewood-rpt I'll talk to the user and see how we can handle the issue.

plittlewood-rpt commented 1 month ago

Logged internal issue for engineering spike (ENG-125)