-
Notifications
You must be signed in to change notification settings - Fork 234
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
Conversation
@@ -90,6 +72,13 @@ export default class ExtendedRouterStore extends RouterStore { | |||
newQuery = newParams; | |||
} | |||
|
|||
// clear out any undefined props |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
…te undefined params
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.