Skip to content

Conversation

@richard-to
Copy link
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
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

3 participants