Skip to content

fix(debug): bump pysignalr to 1.3.3 to keep negotiate cookies on the WebSocket upgrade - #2016

Open
dianagrecu-uipath wants to merge 2 commits into
mainfrom
fix/debug-bridge-negotiate-cookies
Open

dianagrecu-uipath wants to merge 2 commits into
mainfrom
fix/debug-bridge-negotiate-cookies

Conversation

@dianagrecu-uipath

@dianagrecu-uipath dianagrecu-uipath commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Bump pysignalr from 1.3.0 to 1.3.3 in packages/uipath (pyproject.toml, uv.lock).
  • SignalRDebugBridge._send passes a completion callback to send(), so SendCommand calls keep an invocationId and hub-side errors still reach _handle_error.
  • Bump uipath to 2.15.6.
  • Add tests/cli/test_signalr_debug_hub.py: two tests against a local SignalR hub.

Why

SignalRDebugBridge connects to the debug hub with pysignalr. In 1.3.0, pysignalr sends the negotiate request from a short-lived aiohttp session and then opens the WebSocket with the websockets library, so any cookie set by the negotiate response is dropped.

When the hub runs on more than one server behind a load balancer that pins SignalR connections with a cookie, the WebSocket upgrade can reach a server that does not know the connection id. That server answers 404, and the debug job fails with Failed to establish WebSocket connection within 10s timeout.

pysignalr 1.3.3 forwards the negotiate cookies to the WebSocket handshake (see its changelog).

Since 1.3.1, pysignalr's send() only adds an invocationId when an on_invocation callback is given. Without one, the hub does not reply, so a failed SendCommand would no longer be logged by _handle_error. The bridge now passes a no-op callback; errors still arrive through on_error, as on 1.3.0.

Other pysignalr changes in 1.3.1 to 1.3.3, checked against the bridge

  • SignalR keepalive ping every 15 s (was 10 s) and WebSocket ping every 20 s (was 10 s). 15 s is the default keepalive of the browser and .NET SignalR clients.
  • A close timeout is now set, equal to the connection timeout.
  • Return values of on() handlers are now sent back when they are not None (was: when truthy). The bridge's handlers return nothing.
  • Invocation messages now include "headers": {}, a standard SignalR field.
  • A custom SSL context is now also used for the negotiate request. The bridge does not pass one.
  • MessagePack and streaming fixes. The bridge uses the JSON protocol and no streams.
  • websockets is allowed in the range >=15.0.1,<18.

Testing

  • tests/cli/test_signalr_debug_hub.py:
    • The WebSocket upgrade carries the cookie set by negotiate. Fails on 1.3.0, passes on 1.3.3.
    • A SendCommand rejected by the hub reaches _handle_error. Fails without the completion callback.
  • Debug, bridge and breakpoint tests (-k "debug or bridge or signalr or breakpoint" over tests/cli and tests/functions) pass.
  • ruff check, ruff format --check, mypy and scripts/lint_httpx_client.py are clean on the changed files.
  • Downstream suites requested with the test:uipath-langchain and test:uipath-runtime labels.
  • Not done yet: a manual debug run against a hub with more than one server.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The upgrade silently drops hub-side failures for debug commands because sends omit an invocation callback, requiring a callback fix and a regression test to preserve error reporting.

1 open issue
What changed in this PR

This PR updates the UiPath SDK’s SignalR dependency to preserve negotiate cookies during WebSocket upgrades, addressing debug connection failures behind cookie-based load balancers.

Changes:

  • Upgrade pysignalr from 1.3.0 to 1.3.3.
  • Bump uipath to 2.15.6 and synchronize the lockfile.
  • Add a local-server regression test verifying cookie forwarding.
File Description
packages/​uipath/​uv.lock Updates dependency artifacts and the SDK version.
packages/​uipath/​tests/​cli/​test_signalr_negotiate_cookies.py Verifies the WebSocket upgrade includes the negotiate cookie.
packages/​uipath/​pyproject.toml Pins pysignalr 1.3.3 and sets version 2.15.6.

Review effort: Balanced

Comment thread packages/uipath/pyproject.toml Resolved
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Nov 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants