Fix subscribe arg ordering so fresh args override stale descriptor-backed instance properties#2175
Merged
Conversation
…cked instance properties
In multiplexed mode, connectionQueryArguments was built by spreading parameterValues
(instance property values) AFTER the caller-supplied args, meaning a stale instance
property would silently overwrite a fresh value passed directly to subscribe().
Reorder the spread so parameterValues comes first and caller-supplied args win:
{ ...parameterValues, ...(directMode ? unusedParameters : args), ...paging }
In direct mode the route parameters are already embedded in the URL path, so only
the non-route (unused) parameters are appended as query arguments — unchanged.
In multiplexed mode the full args object is included so route-derived parameters
reach the server in the subscribe payload — also unchanged in intent.
Fixes #2174.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…params
Two new specs cover the scenarios fixed in the preceding commit:
- with_hub_mode_and_stale_descriptor_backed_instance_property: verifies that
fresh args passed to subscribe() override stale descriptor-backed instance
property values (filter = 'stale-filter' → 'fresh-filter' wins in payload).
- with_hub_mode_and_multiple_required_route_parameters: verifies that all
route-derived parameters (userId, category from /api/filter/{userId}/{category})
appear in the multiplexed subscribe payload.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed
subscribe(). Route-derived parameters continue to be included in the subscribe payload as before. (Multiplexed observable queries omit route parameters from subscribe arguments #2174)