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

feat(#174): arc github lock #176

Merged
merged 9 commits into from
Oct 3, 2024
Merged

feat(#174): arc github lock #176

merged 9 commits into from
Oct 3, 2024

Conversation

h1alexbel
Copy link
Owner

@h1alexbel h1alexbel commented Sep 26, 2024

In this pull I've fixed bug with broken user registration via Arc<Mutex<GitHub>>, introduced new tests to catch this problem in the future.

closes #174
History:


PR-Codex overview

This PR focuses on enhancing thread safety in the FakeHub structure by using Arc<Mutex<GitHub>>, ensuring concurrent access is managed properly. Additionally, it refactors various functions and updates user handling to improve reliability and maintainability.

Detailed summary

  • Changed github in FakeHub to Arc<Mutex<GitHub>> for thread safety.
  • Updated main() method to return Arc<Mutex<GitHub>>.
  • Refactored user handling in multiple handlers to lock the GitHub instance before accessing users.
  • Modified Coordinates struct to hold a reference to FakeHub.
  • Adjusted method signatures to accept references where appropriate.
  • Enhanced tests to validate user registration and properties.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@l3r8yJ
Copy link
Collaborator

l3r8yJ commented Sep 26, 2024

@h1alexbel can we wait this pr before merging this one?

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.13%. Comparing base (c471234) to head (598e66d).
Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
server/src/handlers/register_user.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
- Coverage   83.15%   82.13%   -1.03%     
==========================================
  Files          16       16              
  Lines         285      291       +6     
==========================================
+ Hits          237      239       +2     
- Misses         48       52       +4     

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

@h1alexbel
Copy link
Owner Author

@l3r8yJ I think yes, if it would be fast to merge types PR

@h1alexbel h1alexbel requested review from l3r8yJ and removed request for l3r8yJ September 26, 2024 15:35
@h1alexbel
Copy link
Owner Author

@l3r8yJ take a look, please

@h1alexbel h1alexbel requested a review from l3r8yJ September 26, 2024 15:46
@h1alexbel
Copy link
Owner Author

@l3r8yJ take a look, please

1 similar comment
@h1alexbel
Copy link
Owner Author

@l3r8yJ take a look, please

@h1alexbel h1alexbel merged commit 22448a3 into master Oct 3, 2024
13 of 14 checks passed
@h1alexbel h1alexbel deleted the 174 branch October 3, 2024 07:00
@0crat
Copy link

0crat commented Oct 3, 2024

@h1alexbel Hey there, awesome work on your contribution! 👍 You've earned +4 points, which breaks down like this: +4 base points, +6 for your 139 hits-of-code (nice job!), but -16 because there wasn't a code review (oops!). We bumped it up by +9 to keep you motivated. Your total balance is now +63. Remember, code reviews are super important - they can boost your points and improve code quality. Keep the contributions coming and aim for that sweet spot of 200-800 hits-of-code for max points! Keep up the great work!

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.

can't register user
3 participants