Skip to content

Conversation

@akshayka
Copy link
Contributor

@akshayka akshayka commented Jun 20, 2025

This fixes a regression that caused mo.query_params() to stop working. We need to send all query parameters to the backend, not just known ones, as part of the websocket URL.

Tested by playing with the query parameters smoke test (_marimo/smoke_tests).

Fixes #5376.

@akshayka akshayka requested a review from dmadisetti June 20, 2025 22:09
@vercel
Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 10:22pm

}
}

// Move over window level parameters to the WebSocket URL
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dmadisetti Was there a reason for stripping unknown query parameters? This breaks mo.query_params().

Was this code too aggressively refactored, i.e. is there a codepath that relies on query parameter stripping?

Copy link
Collaborator

Choose a reason for hiding this comment

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

A little too conservative - with the refactor query params were not passed down at all. Thanks for the general fix

Comment on lines +60 to 65
if (
restrictToKnownQueryParams &&
!Object.values(KnownQueryParams).includes(key)
) {
continue;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I included this in case other code paths do need to restrict to known query parameters.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Likely not needed

Copy link
Contributor Author

@akshayka akshayka Jun 21, 2025

Choose a reason for hiding this comment

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

Got it, so just don't filter known query params, pass all through?

Edit: nvm, saw your approval.

Copy link
Collaborator

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

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

Thanks for the unit test too

@akshayka akshayka merged commit 1c12995 into main Jun 21, 2025
23 of 24 checks passed
@akshayka akshayka deleted the aka/fix-query-param-in-ws branch June 21, 2025 06:39
akshayka added a commit that referenced this pull request Jun 21, 2025
This fixes a regression that caused `mo.query_params()` to stop working.
We need to send all query parameters to the backend, not just known
ones, as part of the websocket URL.

Tested by playing with the query parameters smoke test
(`_marimo/smoke_tests`).

Fixes #5376.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
sebbeutler pushed a commit to sebbeutler/marimo that referenced this pull request Jun 28, 2025
This fixes a regression that caused `mo.query_params()` to stop working.
We need to send all query parameters to the backend, not just known
ones, as part of the websocket URL.

Tested by playing with the query parameters smoke test
(`_marimo/smoke_tests`).

Fixes marimo-team#5376.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
sebbeutler pushed a commit to sebbeutler/marimo that referenced this pull request Jul 7, 2025
This fixes a regression that caused `mo.query_params()` to stop working.
We need to send all query parameters to the backend, not just known
ones, as part of the websocket URL.

Tested by playing with the query parameters smoke test
(`_marimo/smoke_tests`).

Fixes marimo-team#5376.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

Marimo 0.14 breaks query params (at least locally)

3 participants