-
Notifications
You must be signed in to change notification settings - Fork 2
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
NickAkhmetov/CAT-634 Fix selection of samples on organ page when more than 500 are present #3595
NickAkhmetov/CAT-634 Fix selection of samples on organ page when more than 500 are present #3595
Conversation
@@ -243,21 +243,14 @@ export function useAllSearchIDs( | |||
); | |||
|
|||
const totalHitsCount = getTotalHitsCount(searchData); | |||
const numberOfPagesToRequest = totalHitsCount ? Math.ceil(10000 / totalHitsCount) : undefined; |
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.
Does this continue to handle > 10k results?
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.
That is definitely worth testing to be safe in the long run - I can test it out with a query for all samples without any filters and confirm whether it works as expected.
The 10k results limitation is definitely worth keeping in mind in general, but I am curious - per #3593, it seems like we aren't as close to the 10k result threshold as we thought once we filter samples without descendant datasets, so maybe this could be a premature optimization?
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.
I would slightly prefer to keep the logic to handle this in place rather than have to re-visit suddenly it in the future if something changes.
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.
We have ~7k datasets with HuBMAP Read
.
Following John's feedback, I've made some improvements to the On login with HuBMAP Read, there are >20,000 kidney samples, so I was able to confirm the fix: Screen.Recording.2024-11-05.122353.mp4It is worth noting that adding the selected to a list caused the page to freeze. This might become a bigger issue if we start persisting lists in a key-value store. |
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.
Looks good to me! We could likely avoid the additional forEach
call, but not a big deal. I wasn't aware of the _
convention in numbers for readability so thanks for teaching me that!
Summary
The Kidney page on prod currently fails to select all results when using the "select all" checkbox of the samples table. This issue was caused by the
useAllSearchIds
hook being limited to only fetching the first 500 results. Lifting this limit/removing the "number of pages to fetch" from the ID lookup resolved this issue by enabling lookup of all 634 results in the table.Design Documentation/Original Tickets
https://hms-dbmi.atlassian.net/browse/CAT-634
Testing
Tested on the kidney page as well as other organ pages.
Screenshots/Video
Screen.Recording.2024-11-04.104133.mp4
Checklist
CHANGELOG-your-feature-name-here.md
is present in the root directory, describing the change(s) in full sentences.Additional Notes
I'm not sure if this PR overlaps with the changes in the searchkit PR - it can definitely wait if so.