-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-14911] Fix DDG IPC errors where big messages are split #11987
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #11987 +/- ##
==========================================
- Coverage 33.49% 33.48% -0.01%
==========================================
Files 2846 2846
Lines 89197 89197
Branches 17003 17003
==========================================
- Hits 29874 29867 -7
- Misses 56970 56977 +7
Partials 2353 2353 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Fixed Issues
|
dani-garcia
force-pushed
the
ps/fix-ddg-ipc-big-messages
branch
from
November 13, 2024 17:50
a50a6e5
to
049d51c
Compare
dani-garcia
changed the title
Fix IPC errors with DDG caused by big messages being split
[PM-14911] Fix DDG IPC errors where big messages are split
Nov 14, 2024
1 task
# Conflicts: # apps/desktop/desktop_native/core/src/ipc/server.rs
1 task
addisonbeck
approved these changes
Nov 19, 2024
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-14911
📔 Objective
The IPC connection code was assuming that each call to
read
in the IPC socket would return one and only one message. This is incorrect for multiple reasons:We haven't noticed this before as the messages we send for biometrics are well under the limit, plus we don't send them very frequently.
To fix this, we can wrap the IPC stream in a
LengthDelimitedCodec
, this codec will send each message with their length as a prefix, and make sure to split the messages correctly, independently of how the multipleread
calls might split them. We're already using this codec for the stdin/stdout ofdesktop_proxy
as that is what the Native Messaging Host spec requires, so might as well do it here too. Big points totokio
for how flexible and easy to use the codec implementation is.📸 Screenshots
⏰ Reminders before review
🦮 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