stjude / proteinpaint

Data visualization and analysis framework focused on phenotype-molecular data integration at cohort level.
https://proteinpaint.stjude.org/
Other
13 stars 3 forks source link

Backwards compatibility fix for old saved sessions missing .isOrdered… #1748

Closed creilly8 closed 2 weeks ago

creilly8 commented 2 weeks ago

… and/or .disabled

Description

PR as a suggested fix for issue found an old session file by @karishma-gangwani. Without this fix, Error: Cannot read properties of undefined (reading 'isOrdered') appears.

Checklist

Check each task that has been performed or verified to be not applicable.

karishma-gangwani commented 2 weeks ago

I think the callbacks for the 'sortByMutation' and 'sortByCNV' would also need to be checked? because the sorting functionality on the UI won't work with that session file.

creilly8 commented 2 weeks ago

@karishma-gangwani and I figured out that the sorting still doesn't work with this change because there is only one tiebreaker entry under sortPriority (see matrix.controls.js, line 22).

siosonel commented 2 weeks ago

@creily I thought I had fixed this issue before, see the reshapeSortPriority() function in matrix.sort.js. Some logic would need to be added to this function to consider other saved sessions that are not handled properly. Making the change inmatrix.config.js is likely not sufficient because other parts of the code now expect the new sorter config shape.

I can push a fix in this branch.

siosonel commented 2 weeks ago

@creilly8 I fixed by editing the recovered session state using each plot's applicable getPlotConfig(). However, there are still cases that would not be recovered/rehydrated correctly, such as when the saved session uses a dictionary term that no longer exists on the server. EDIT: The missing terms are actually present after I used getDataset.js to update the mbmeta db file.