Repository navigation
id(web): send selected files to another server (#5346) - #10506
Conversation
Web adapter for the #5345 server-to-server transfer, now that the transfer module has landed (PR #7905): - POST /api/files/send: carries only references (file name, destination node ID, optional dest name / replace flag) — this server performs the transfer itself through id_sync::transfer::send_file with its own endpoint identity, so no bytes pass through the browser. Success is answered only from the transfer receipt (destination confirmed blob completion + name registration). Structured errors: 400 empty name / invalid dest, 404 unknown file, 409 conflict (refused before any bytes move), 502 transfer failed (incl. an unallowlisted destination denying the send), 503 when the serving process wired no endpoint. - AppState gains transfer_endpoint; id serve passes its node endpoint through web_routers_with_surface. Destination authorization is the destination's own write policy against the source server, exactly as for CLI/REPL sends. - File-list bulk action bar gains a destination node ID input and a "Send to server…" action; main.ts sends each selected file with one POST and counts a file as sent only on an OK response with a well-shaped receipt (isSendFileResponse guard, #7837 pattern). - WEB.md route table updated. Tests: - id-web send_file_tests (6): 400/503/404 validation, plus an in-process two-server probe through the handler — send copies the blob and registers the name (source untouched), retry is idempotent (already_present), conflict refuses by default and replace archives + lands, unallowlisted destination denies and gains no name. - vitest file-op-responses: isSendFileResponse guard cases. - Full id-web lib suite: 672 passed, 1 pre-existing failure (test_load_asset_urls_from_manifest, also failing on clean main — web/dist manifest not built in a bare worktree). - tsc --noEmit pass. Clippy not run to completion locally: the pooled target dir mixes rustc 1.99.0 artifacts with the 1.99.1 clippy driver (E0514 on untouched crates). Queue task 9495.
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
|
🤖 Agent note · merge disposition (task 9495, lane code-d)
|
Implements #5346, the web adapter for server-to-server file send. Its gate has cleared: issue #5345 closed with PR #7905 merged 2026-11-14, landing the shared
transfermodule this adapter calls.What
POST /api/files/send(id-web): the browser carries only references — file name, destination node ID, optional destination name andreplaceflag — and this server performs the transfer itself throughid_sync::transfer::send_filewith its own endpoint identity. No bytes through browser JavaScript. The 200 response is built from the transfer receipt, so success is shown only after the destination confirmed blob completion and name registration.replaceto archive + replace), 502 transfer failed (including an unallowlisted destination denying the send), 503 when the serving process wired no transfer endpoint.AppStategainstransfer_endpoint;id servepasses its node endpoint throughweb_routers_with_surface(other constructors default toNone→ 503).irohmoves from dev-dependencies to dependencies ofid-web(already in the lock viaid-sync).bulkSendToServerposts one send per selected file and counts a file as sent only on an OK response carrying a well-shaped receipt (isSendFileResponse, the id(web/main): /api/save, /api/new, /api/rename and /api/copy responses shape-trusted — a wrong-shape 200 reports save success with dataset.hash 'undefined' or navigates to /edit/undefined #7837 guard pattern) — failures are reported per file, never as success.WEB.mdroute table updated.Tests
cargo test -p id-web --lib send_file— 6 passed: 400/503/404 validation, plus an in-process two-server probe through the handler: send copies the blob and registers the name on the destination (source untouched, copy not move), a retry returnsalready_present, a conflict refuses by default (409, destination untouched) andreplacearchives and lands, and an unallowlisted destination denies the send (502) and gains no name. Interruption safety is the transfer module's bytes-before-name ordering, covered by the id: server-to-server file transfer protocol and CLI/REPL #5345 tests inpkgs/id/tests/transfer.rs.cargo test -p id-web --lib: 672 passed, 1 failed —test_load_asset_urls_from_manifest, which also fails on cleanmainin a bare worktree (web/dist manifest not built); unrelated to this change.vitest run src/file-op-responses.test.ts— 13 passed.tsc --noEmit— pass.Queue task 9495 (lane code-d). Closes #5346.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit