Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overwriting of empty parameters on modify query (and all other updateURL calls) #2925

Merged
merged 2 commits into from
Dec 13, 2019

Conversation

alisman
Copy link
Collaborator

@alisman alisman commented Dec 10, 2019

Prior to URLWrapper, modify query cleared all existing query params and replaced them with newly submitted. But ULWrapper changed that to allow persisting of existing non-URL sessions. A problem arose when we submit an empty parameter (e.g. mutation profile type). On submit the code was stripping out empty params which had the affect of retaining the old value. THis is fixed by accomplishing the overwrite in the routing store where we ALWAYS overwrite all the URL params.

Fixes: cBioPortal/cbioportal#6894

To reproduce bug, make a single study query and then modify query by updating genomic profile. You can't update it.

@jjgao jjgao temporarily deployed to cbioportal-f-fxsub-szpympmwm8k December 11, 2019 18:52 Inactive
@jjgao jjgao temporarily deployed to cbioportal-f-fxsub-szpympmwm8k December 11, 2019 20:45 Inactive
@jjgao jjgao temporarily deployed to cbioportal-f-fxsub-szpympmwm8k December 11, 2019 21:02 Inactive
@alisman alisman changed the title Fx sub Fix overwriting of empty parameters on modify query (and all other updateURL calls) Dec 11, 2019
@@ -90,6 +72,13 @@ export default class ExtendedRouterStore extends RouterStore {
newQuery = newParams;
}

// clear out any undefined props
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

newQuery will have ALL params in URL, so here we can just delete entrees that are empty. nothing can survive.

@@ -25,14 +25,6 @@ export function queryParams(nonMolecularProfileParams:NonMolecularProfileQueryPa
molecularProfileParams:MolecularProfileQueryParams) {
let params:CancerStudyQueryUrlParams = Object.assign({}, nonMolecularProfileParams, molecularProfileParams);

// Remove params with no value, because they may cause problems.
// For example, the server will always transpose if transpose_matrix is present, no matter the value.
for (let key in params) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

doing this here meant that the routing store updateURL call would not get a value for this param, which would then allow any OLD param to be retained

@alisman alisman marked this pull request as ready for review December 11, 2019 23:10
@jjgao jjgao temporarily deployed to cbioportal-f-fxsub-arfgqpavnyp December 13, 2019 14:37 Inactive
@alisman alisman merged commit 5f7168e into cBioPortal:master Dec 13, 2019
@alisman alisman deleted the fxSub branch December 13, 2019 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants