Skip to content

Fix query params not being read/updated correctly in WebSocket mode (#1283)#1326

Closed
richard-to wants to merge 1 commit intomainfrom
claude/debug-issue-1283-dYwLZ
Closed

Fix query params not being read/updated correctly in WebSocket mode (#1283)#1326
richard-to wants to merge 1 commit intomainfrom
claude/debug-issue-1283-dYwLZ

Conversation

@richard-to
Copy link
Copy Markdown
Collaborator

This fixes two bugs in query parameter handling:

  1. initialize_query_params wasn't clearing existing params before
    initializing new ones. In WebSocket mode, the Context is persistent
    across requests (stored in self._contexts), so old query params would
    stick around when they should be cleared. This caused query params
    from the URL to not be read correctly on subsequent navigations.

  2. set_query_param was passing values=None to the protobuf when
    deleting a query param (value=None case), instead of values=[].
    This caused the URL to not be updated correctly when query params
    were deleted.

These bugs only manifested in WebSocket mode because in regular SSE mode,
a new Context is created for each request (stored in Flask's g object).

Fixes #1283

…1283)

This fixes two bugs in query parameter handling:

1. **initialize_query_params** wasn't clearing existing params before
   initializing new ones. In WebSocket mode, the Context is persistent
   across requests (stored in self._contexts), so old query params would
   stick around when they should be cleared. This caused query params
   from the URL to not be read correctly on subsequent navigations.

2. **set_query_param** was passing `values=None` to the protobuf when
   deleting a query param (value=None case), instead of `values=[]`.
   This caused the URL to not be updated correctly when query params
   were deleted.

These bugs only manifested in WebSocket mode because in regular SSE mode,
a new Context is created for each request (stored in Flask's g object).

Fixes #1283
@richard-to richard-to closed this Feb 10, 2026
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.

Query params not being read or updated correctly in Web Sockets mode

2 participants