Skip to content

[Bug]: Remote in-app browser hangs at Connecting before real-tab preview WebSocket upgrade #799

Open

Description

@Jacksondr5

Before submitting

  • Searched existing issues and did not find a duplicate.
  • Included observed reproduction steps, live evidence, and the limits of the diagnosis.

Area

apps/server; apps/web preview surface

Summary and impact

The in-app browser remains at Connecting… when viewing a running application through a remote J5 web client. The URL and title are available, but the page never renders and browser input remains disabled. This blocks reviewing the application in the shared browser; chat and the terminal continue to work.

Steps to reproduce

Observed on the deployment below; an isolated, minimal reproduction is still needed.

  1. Open the remote J5 web client in Chrome Incognito, signed in as a person with Collaborator access to a thread.
  2. Open that thread's existing server-browser tab for a reachable local web application.
  3. Observe the browser panel staying at Connecting… without rendering the page.
  4. Open a fresh server-browser tab for the same application and select it. The fresh tab also stays at Connecting….

The application was served on a loopback port on the J5 server. A request made from that server returned HTTP 200 during the investigation.

Expected behavior

The preview WebSocket upgrades, the page becomes visible, and the collaborator can use the browser. If browser initialization fails, show an actionable error within a bounded time.

Actual behavior and evidence

  • J5's main /ws connection completes 101 Switching Protocols; chat and terminal operations work.
  • Real browser tabs' /api/preview-stream/ws?threadId=<thread>&tabId=<real-tab> connections do not complete the upgrade while the panel remains Connecting….
  • An observed real-tab connection eventually closed with WebSocket code 1006 after approximately four minutes, and the client started another attempt. The timeout's owner has not been established.
  • A diagnostic request using the same authenticated session, thread, origin, and preview-stream endpoint, but a nonexistent tab ID, completed the upgrade and closed cleanly with 4404 / tab closed. This demonstrates that the preview WebSocket route can pass through the proxy and authentication path.
  • A passive (interactive=false) attempt to the real tab also failed to establish the stream.
  • The live nginx configuration forwards HTTP/1.1, Upgrade, and Connection headers and disables proxy buffering. No proxy configuration was changed.
  • A thread-scoped download request for a nonexistent download returns the expected 404, rather than a scope rejection. A request without the thread parameter is rejected with insufficient_scope. The permission omission described in People and access: a Collaborator on a thread or project sees its preview tabs #796 is already addressed in the running build.

Version or commit

0.0.52-nightly.20261029.12, release commit b306d598927b695b90e6f01303e0d3ec70774378.

The live server process executable and the web client's reported version were checked against this release.

Environment

Chrome 154 on macOS, Incognito; remote Ubuntu server behind nginx 1.24.0 with TLS. Observed October 29, 2026 (US Eastern).

Diagnosis and remaining uncertainty

The evidence narrows the failure to real-tab viewer initialization before the WebSocket upgrade. It does not establish which Chrome/CDP operation blocks.

In this release, ServerBrowserStream.ts awaits browser.attachViewer() before request.upgrade.

attachViewer() includes finding/opening the tab, creating a CDP session, control setup, starting the screencast, and potentially capturing an initial screenshot before returning. An unresolved operation along this path can prevent the upgrade and leave the client at Connecting….

The nonexistent-tab result takes a different branch and successfully upgrades before reporting 4404. That supports investigating the real-tab initialization path, rather than treating this as a general WebSocket connectivity failure.

Suggested investigation and acceptance

  • Add stage timings around tab lookup/open, CDP attachment, control acquisition, screencast startup, and initial screenshot capture to identify the unresolved operation.
  • Reproduce against an isolated server using real Chromium and collaborator access; mocks alone may miss the CDP behavior.
  • Fix the blocking operation and ensure initialization failure reaches the client within a bounded time. Evaluate whether first-frame capture should hold up the WebSocket handshake.
  • Verify both existing and fresh tabs, passive and interactive viewing, and an explicit initialization-failure case.

Related issues

Fix applied or workaround

No fix, service restart, or deployment was performed. Diagnostic tabs and temporary client-side WebSocket observers were removed, and the original layout was restored. No verified workaround yet.

Screenshots and raw headers are intentionally omitted because the inspected page contains private conversation content and authentication material.

Activity

  1. added
    bug
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions