Skip to content

[pipeline-manager] Fix ad-hoc not working in Chromium-based browsers by confirming the requested subprotocol#6711

Open
Karakatiza666 wants to merge 2 commits into
mainfrom
fix-adhoc
Open

[pipeline-manager] Fix ad-hoc not working in Chromium-based browsers by confirming the requested subprotocol#6711
Karakatiza666 wants to merge 2 commits into
mainfrom
fix-adhoc

Conversation

@Karakatiza666

@Karakatiza666 Karakatiza666 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The issue is web-console uses websocket subprotocol headers to pass the auth information to pipeline-manager, but for a successful websocket handshake the browser needs to receive at least one subprotocol back. The existing handler in pipeline-manager does not do that, so a custom code for that was needed. The ad-hoc queries were broken when authentication is enabled in chromium-based browsers but not Firefox, because the latter is more relaxed regarding this rule and allows ws connections without this handshake

The issue manifested as not being able to use adhoc queries through web-console in a chromium-based browser while auth is enabled - a visible error on any query

Testing: manual, added unit tests

…by confirming the requested subprotocol

Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
@Karakatiza666
Karakatiza666 requested a review from snkas July 23, 2026 12:53
@Karakatiza666
Karakatiza666 enabled auto-merge July 23, 2026 12:55
Signed-off-by: feldera-bot <feldera-bot@feldera.com>

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good fix. Chromium follows the WHATWG WebSocket handshake step that requires the server to echo one of the offered subprotocols; when the client offers feldera-bearer.* / feldera-tenant.* and the manager echoes none, the browser aborts with 1006. Introducing a non-secret sentinel feldera-ws-v1 and echoing it (falling back to the first offered protocol for older consoles) is the right shape. Tests cover the three interesting cases: no offer, sentinel-preferred, sentinel out of order, and the legacy fallback. Non-blocking notes:

  • Handshake response can never contain a pre-existing Sec-WebSocket-Protocol header from actix_ws::handle, so insert (not append) is correct — worth a one-line comment to that effect for the next reader.
  • The HeaderValue::from_str branch silently drops the header on error. All valid subprotocol tokens are ASCII-visible (already parsed once by actix), so the branch is unreachable in practice; a warn! there would still make it discoverable if the invariant ever changes.
  • Trailing space on the /// line above select_ws_subprotocol's last paragraph — trivial.

@snkas snkas 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.

I'm missing context on the WebSocket protocol usage of the API, so deferring to @gz for the review as he originally added the support specifically for adhoc queries.

@snkas
snkas requested a review from gz July 23, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants