Repository navigation
perf(preview): pipeline and cache remote HTML resources - #3579
Merged
Merged
Conversation
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
Remote HTML previews currently wait for each 256 KiB chunk before requesting the next, and reload every resource body. Pipeline bounded reads and retain short-lived, owner-revalidated resource bytes so SSH workspaces and Desktop/CLI Peer Device previews load sooner while preserving workspace confinement and explicit offline errors.
Type and Areas
Type: performance improvement / bug fix
Areas: shared remote resource transfer service, Desktop HTML gateway, SSH/SFTP and encrypted Relay integration fixtures, CI
Motivation / Impact
no-store.Measurements
Three runs per case, approximately 2.72 MiB total: HTML, 96 KiB CSS, 2 MiB JavaScript, 512 KiB image and 128 KiB font. HTML completes before up to six concurrent asset requests. Every returned byte is checked. The baseline was also measured with the original provider/gateway source from
b4533049a; the committed experiment retains the prior serial chunk algorithm for reproducible comparisons.SSH samples: original
[11057, 11066, 11185], cold[4787, 4745, 4707], warm[835, 841, 824]ms. Peer HTTP samples: original[1548, 1627, 1521], cold[1227, 1285, 1252], warm[91, 91, 91]ms.These measure resource completion with controlled latency, excluding browser rendering and preview bootstrap. They are not measurements of a physical two-machine deployment. The fixtures preserve pipelined SFTP responses and concurrent peer dispatch; timing ratios are deliberately not CI assertions.
Verification
Passed locally:
cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect --lib remote_connect::html_preview— 18 tests covering ordering, read/memory bounds, coalescing, revisions, expiration, explicit refresh, cancellation, account changes and owner path policy.cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-ssh-concrete --lib remote_ssh::manager::tests::workspace_sftp::— 10 passed, 4 opt-in/diagnostic tests ignored.OPENBITFUN_TEST_SFTP_SERVER=/usr/libexec/sftp-server cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect,remote-ssh-concrete --lib openssh_html_preview_reads_nested_site_resources -- --ignored— real SSH/SFTP resource test passed.cargo test --locked -p openbitfun-desktop --lib html_preview— 10 passed, 1 opt-in benchmark ignored, including authenticated HTTP and encrypted peer resource transfer.pnpm run fmt:rs,pnpm run check:github-config,pnpm run check:core-boundaries,pnpm run check:repo-hygiene,git diff --check, and the Git object-size check passed. GitHub config tests: 54 passed, 1 PowerShell-dependent test skipped locally.Also passed
pnpm run build:web,cargo build --locked -p openbitfun-desktop, andnode tests/e2e/scripts/run-html-preview.mjson macOS. The isolated native browser verified CSS, module scripts, dynamic imports, images, encoded paths and reloading one preview after opening another.All 14 checks passed on final head
bc00e53cf7ee0ac9ecbbeadc688ebda5559c7b7c, including three-platform CLI and Rust checks, frontend, Linux x64/ARM64 builds and installer validation, and aggregate validation: CI run 40645890814.Reviewer Notes
AI-assisted change; focused automated and loopback protocol tests passed. SSH remote workspaces and Peer Device transport are exercised separately. Mobile/IM Remote Control and Detached Dispatch are not changed or exercised. No persisted format, command registration or wire DTO changed: existing
workspace_html_preview_v1peers continue to work. Cache scope is one controller preview; there is no disk cache or cross-account/device cache.Checklist