Skip to content

Conversation

@eduardoj
Copy link
Member

Previously, there was no distinction between parameters passed to the backend with an empty value.

For example, when parsing the query string ?expand, Rails would include the key but with a nil value in the params hash. When this hash was later serialized back into a query string using the .to_query method, it erroneously resulted in ?expand=.

This incorrect modification caused the backend to throw a 400 error.

This commit resolves the issue by splitting query parameters into two distinct groups of parameters and handling them differently.

See #18976 and #18978.

See previous implementation, where this case was taken in account:

Reference: https://api.rubyonrails.org/v7.2.3/classes/Hash.html#method-i-to_query

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Dec 12, 2025
@eduardoj eduardoj force-pushed the fix/expand_parameters branch from c36c57e to c002b43 Compare December 12, 2025 15:38
@eduardoj eduardoj changed the title Fix empty query parameters in expand_parameters method Fix empty query parameters in expand_params method Dec 12, 2025
@eduardoj eduardoj force-pushed the fix/expand_parameters branch 3 times, most recently from 9cd87af to 5ab4d61 Compare December 15, 2025 13:22
@eduardoj eduardoj marked this pull request as ready for review December 15, 2025 13:22
Previously, there was no distinction between parameters passed to the
backend with an empty value.

For example, when parsing the query string `?expand`, Rails would
include the key but with a nil value in the `params` hash. When this
hash was later serialized back into a query string using the `.to_query`
method, it erroneously resulted in `?expand=`.

This incorrect modification caused the backend to throw a 400 error.

This commit resolves the issue by splitting query parameters into two
distinct groups of parameters and handling them differently.
@eduardoj eduardoj force-pushed the fix/expand_parameters branch from 5ab4d61 to d28418d Compare December 15, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Things related to the OBS RoR app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant