Repository navigation
perf(ssh): desktop and CLI read compressed frames from remote hosts - #39659
Merged
Merged
Conversation
…t platforms Move the length checks and decode of paired E2EE compressed frames into the shared module behind a small gzip/UTF-8 codec, so the desktop can read them with node zlib while mobile keeps its native/fflate path.
…ktop and CLI Desktop and CLI sockets to orcad/orca serve now advertise transport.compressed-frames.v1, so a v2 host gzips large text replies and terminal output before sealing them, as it already does for phones. - Every Node client transport (one-shot requests, request connection, shared control, subscriptions) opens frames through one sealed-frame reader that inflates compressed frames on v2 channels, synchronously so frame order and v2 counters stay in arrival order. - A compressed binary frame may claim up to the 8 MB binary outbound cap (terminal frames can exceed the 4 MB JSON cap), for phones too. - ORCA_DISABLE_MOBILE_COMPRESSED_FRAMES=1 now also stops a desktop or CLI from asking for compressed frames. - Relayed phones and the browser client are unchanged.
…fy capability comment
Text-only sockets report an authentic binary payload as an unexpected binary frame again, and tell a decrypt failure apart from a corrupt compressed frame, instead of calling every failure undecryptable.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Merged
11 tasks done
This file contains hidden or 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
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.
Summary
orcad already gzips (level 1) text frames and compressible binary frames (terminal output, snapshots) before sealing them on v2 E2EE framing — but only for clients advertising
transport.compressed-frames.v1, and only mobile did. The desktop↔orcad link over SSH was therefore uncompressed (and compression can't happen below the E2EE layer).paired-e2ee-compressed-frame.tswith a small per-platform gzip/UTF-8 codec (mobile keeps its native/fflate path).remote-runtime-sealed-frame.ts: single place Node client sockets open frames (one-shot requests, request connection, shared control, subscriptions); inflates on v2 only, synchronously to preserve frame order; size-capped and checked against the claimed length.ORCA_DISABLE_MOBILE_COMPRESSED_FRAMES=1also stops desktop/CLI from asking.Impact (gzip level 1, real coloured output)
ls -R~3–8× less bandwidth for TUI output, chat frames, snapshots and reconnect catch-up. Frames <~1KB (keystroke echo) stay uncompressed. Gunzip of a 4–16KB frame ≈ 5–25µs, roughly offset by decrypting less ciphertext.
Risk: low
Per-socket capability gate both ways (old desktop never asks; old orcad ignores the ask); v2 only; env kill switch on both sides; relayed phones and browser client unchanged.
Verification
pnpm tc(node/web/cli) + mobile typecheck, oxlint, oxfmt: passremote-runtime-client-framing.integration.test.ts8/8 (new cases fail if inflate or the error classification is reverted)wsl-host-deployment-storeand mobile-desktop-relay flakes also fail on main