feat: support chunked transfers and consolidate relay hardening - #28
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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. |
|
@codex review |
|
@codex security review |
|
Claude review session: https://claude.ai/code/session_016xQpcqc6PgtSkV6kJCXfW5 |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Docker builds enable Corepack to use the pinned Yarn release and copy all workspace manifests before the immutable install. The runtime preserves the dependency layout and starts Node directly as the non-root user, without requiring Yarn or a Corepack download at startup.
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.node:24-alpine. The original Dockerfile reproduces the Yarn 1.22.22 version conflict. The final image passes its health check with networking disabled; two Socket.IO clients pair, exchange a transfer chunk and its acknowledgement, and SIGTERM shuts down PID 1 with exit code 0.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.