-
Notifications
You must be signed in to change notification settings - Fork 6
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
audit: ensure unsafe blocks are really safe [WPB-10887] #895
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #895 +/- ##
==========================================
- Coverage 78.44% 78.40% -0.05%
==========================================
Files 113 113
Lines 20097 20166 +69
==========================================
+ Hits 15766 15811 +45
- Misses 4331 4355 +24
Continue to review full report in Codecov by Sentry.
|
I see only some of the crates are covered by Regarding the rest, such as Ideally, it would be nice if we could configure some lints globally, so that we don't have to repeat this everywhere. I think this is one of those that could make sense to apply globally. |
66b4c1a
to
5b39ab7
Compare
…ctions Note that every individual crate in the workspace has to explicitly opt-in to this policy.
Transmutation is intrinsically unsafe, and the safety checks here were insufficient. We'll accept a small loss of flexibility here (the introduction of the `'static` bound) in exchange for some _much_ better guarantees, and eliminating our responsibility for this unsafe block entirely.
55340fd
to
3d87ffa
Compare
Previously it had simply inherited the safety comment from a completely different `unsafe impl` family, for a different type
Turns out that we are doing some pretty naive/unsafe things with regard to `TransactionWrapper`. Ultimately this comes down to the fact that we're using the wrong tool for the job: the advice from the maintainers of rusqlite regarding async is "don't use this tool in that context." In the meantime, we can't easily change any of these problems... but we can at least document them!
There used to exist a safety note for the unsafe impls of auto-traits for `SqlCipherConnection`. Unfortunately, it straight-up lied about the properties of the struct. Fixing this involved adding a mutex, which required removing the `Deref` and `DerefMut` implementations, which then propagated into some moderately widespread code changes. Nothing too interesting.
…mpat` In this case, the fix was just to add safety notes, which was nice.
3d87ffa
to
5a64fe4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the best of my knowledge, this is good to go.
Nice work!
What's new in this PR
unsafe
blocks incore-crypto
unsafe
blocksPR Submission Checklist for internal contributors
SQPIT-764
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.