Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition in consultation creation #2299

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

sainak
Copy link
Member

@sainak sainak commented Jul 9, 2024

This pull request fixes a race condition that allowed duplicate consultations to be created. The issue was caused by concurrent requests creating consultations for the same patient. The fix ensures that only one consultation is created for each patient, preventing duplicates.

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 72.97297% with 20 lines in your changes missing coverage. Please review.

Project coverage is 63.77%. Comparing base (e95d98d) to head (af9da5b).
Report is 6 commits behind head on develop.

Files Patch % Lines
...e/facility/api/serializers/patient_consultation.py 62.50% 11 Missing and 7 partials ⚠️
care/utils/lock.py 90.90% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2299      +/-   ##
===========================================
+ Coverage    63.69%   63.77%   +0.07%     
===========================================
  Files          238      239       +1     
  Lines        13384    13407      +23     
  Branches      1908     1908              
===========================================
+ Hits          8525     8550      +25     
+ Misses        4509     4508       -1     
+ Partials       350      349       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sainak sainak force-pushed the sainak/fix/atomicity-of-consultations branch from dbeb92d to 2b13232 Compare July 17, 2024 07:04
config/settings/base.py Outdated Show resolved Hide resolved
@sainak sainak force-pushed the sainak/fix/atomicity-of-consultations branch from cfea5ac to 41bdfb3 Compare August 19, 2024 15:34
@vigneshhari vigneshhari merged commit 72f9e9a into develop Aug 19, 2024
9 checks passed
@vigneshhari vigneshhari deleted the sainak/fix/atomicity-of-consultations branch August 19, 2024 17:19
@sainak sainak mentioned this pull request Aug 21, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants