feat: support chunked transfers and consolidate relay hardening - #28
Open
sidmorizon wants to merge 6 commits into
Open
sidmorizon wants to merge 6 commits into
sidmorizon wants to merge 6 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This was referenced Sep 17, 2026
sidmorizon
marked this pull request as ready for review
September 17, 2026 08:43
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
The relay's three-second per-method limit rejects consecutive Prime Transfer chunks. This change adds bounded chunk forwarding for actual transfer progress, closes message-envelope and response-channel abuse paths, fixes disconnect-during-join admission, combines #26/#27, and consolidates all ten dependency update PRs.
Transfer progress and compatibility
chunkedTransferVersion: 1and the deploymentmaxMessageSizein successful room-join responses. New App senders use these for transport selection and preflight size checks; legacy clients ignore the added fields.sendTransferChunkrequests per connection per second, with at most 64 KiB Base64 data and 72 KiB for the entire JSON envelope. Validate transfer ID, index, and parameters. Invalid chunk input returns 1001; actual chunk throttling returns 1100.Historical client binaries have not been tested across every version combination.
Relay security: #26 and #27
getRoomUserswith a per-connection token bucket (capacity 10, refill 5/second), allowing shipped App pairing/UI queries to overlap with one-second CLI polling. Notify existing room members withuser-joinedafter the peer has joined.remoteId: null, finite numbers, or bounded strings.E2eeErrorserialization. Server crash logging remains available.credentials: true, including credentialed browser polling; remove the unused allowlist configuration. Retain server-generated room-key fields for wire compatibility.1001error for the original caller. Never return it to the responder. Similarly reject correlatable, authorized requests that exceed JSON complexity bounds with an immediate error; discard uncorrelatable or unauthorized input. The legacy request transport limit remainsMAX_MESSAGE_SIZE(default 10 MiB).user-leftevent and remove Socket.IO membership for that room while preserving unrelated rooms on the connection. Make departure from a removed room idempotent so existing client cleanup can finish.The security fixes are integrated without duplicating their membership checks or bypassing the chunk size/rate limits.
Dependency consolidation and ESLint migration
Several resolved versions include newer compatible patches than the original PR targets. ESLint is intentionally upgraded to the current stable 10.10.0 rather than the older target in #12. Migrate to a shared flat config and typescript-eslint 8.70.0, adapt source typing and obsolete suppressions, and lint source/tests across all workspaces with zero warnings. Pin Yarn 4.14.1 and regenerate the existing lockfile format without copying the old Dependabot lockfile-format churn. No permanent resolution overrides are added.
Validation
yarn install --immutablepasses.yarn lintpasses on ESLint 10.10.0, with zero warnings.yarn workspaces foreach --all --exclude @onekeyhq/monorepo run buildpasses.78cbfd9008a7418abdbff114b7ea07c71ba6878e. Six Chrome cross-origin connection/room-creation checks pass withwithCredentialsboth false and true. The real App chunk sender also completes 32 MiB in each direction. These use actual bridge source and synthetic data, not every historical app binary.beginChunkedTransfer; the legacy fallback checks the full encoded message before emitting wallet data, using the advertised limit or the historical 10 MiB default. Live new-to-old oversize probes deliver zero wallet packets and leave both connections open. The App implementation and localized error copy are maintained separately in the App worktree, outside this server PR; already shipped clients cannot gain local preflight from a server update. Earlier capability tests also cover a v5.18 receiver withoutgetTransferType, with real errors/cancellation preserved.git diff --checkpasses.The full recursive dependency audit is not clean: it reports 62 entries across 23 packages (including deprecation notices). Every reported package/version was already present in the pre-consolidation lockfile; this PR does not resolve the repository's entire existing dependency backlog. Examples include engine.io 6.6.4, mongoose 8.17.1, and older minimatch 5.x/9.x paths. Install also retains existing third-party peer warnings.
Consolidates #7, #12, #14, #16, #18, #20, #21, #22, #23, #24, #26, and #27. The original PRs have been closed after consolidation, with references to this PR. This PR remains pending merge.
Related requirement: OK-63101. This PR is not a production deployment.