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

[SM-1413] Resolve Concurrency Issues in C FFI #981

Merged
merged 4 commits into from
Aug 20, 2024
Merged

[SM-1413] Resolve Concurrency Issues in C FFI #981

merged 4 commits into from
Aug 20, 2024

Conversation

coltonhurst
Copy link
Member

@coltonhurst coltonhurst commented Aug 19, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/SM-1413

📔 Objective

The Issue

Through the C FFI, we were running into concurrency issues with multiple Tokio runtimes.

A draft PR showing the concurrency issue with instructions can be found here.

The Fix

This PR fixes this issue for bitwarden-c and bitwarden-py, by preserving the runtime. Thanks @dani-garcia for the fix and working together on this one!

Extra

This also refactors the AccessTokenLogin type as a follow up for testing purposes for Go as initiated by this PR.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@coltonhurst coltonhurst self-assigned this Aug 19, 2024
Copy link
Contributor

github-actions bot commented Aug 19, 2024

Logo
Checkmarx One – Scan Summary & Details347cdae5-da1f-4e3a-b762-a7fdc0e8837f

No New Or Fixed Issues Found

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Project coverage is 58.01%. Comparing base (5149ec3) to head (899820a).
Report is 1 commits behind head on main.

Files Patch % Lines
crates/bitwarden-c/src/c.rs 0.00% 15 Missing ⚠️
crates/bitwarden-py/src/client.rs 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   58.04%   58.01%   -0.03%     
==========================================
  Files         197      197              
  Lines       13633    13640       +7     
==========================================
  Hits         7913     7913              
- Misses       5720     5727       +7     

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

@coltonhurst coltonhurst marked this pull request as ready for review August 19, 2024 22:03
@coltonhurst coltonhurst requested a review from Hinton August 20, 2024 13:13
@coltonhurst
Copy link
Member Author

coltonhurst commented Aug 20, 2024

For posterity:

Going to merge to main, received internal approval to merge as this can be more easily tested by QA when the other integration and binding update PR's come through. This will happen soon as we will not publish until these are merged 😊

It has been tested though by @dani-garcia and I. Both the Go concurrency issues and the Python binding are confirmed to be working.

@coltonhurst coltonhurst merged commit 9134e98 into main Aug 20, 2024
60 of 61 checks passed
@coltonhurst coltonhurst deleted the sm/sm-1413 branch August 20, 2024 14:38
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