Hotfix/v1.107 species cache#1138
Conversation
|
Do you think we need to put this species loading somewhere before we open this page for Dumbo in the dashboard homepage because for the first loading either way is slow @aanchaljain01 |
|
@dadiorchen Thanks for the feedback! Right now, I’ve set up the Species list to load with React Query and cache results, which helps on subsequent loads. For the first load, I agree it would still be slow. We could add a prefetchQuery on the dashboard homepage (or app initialization) so the data is ready before the Species page is opened. Should I go ahead and add that optimization as part of this PR, or do you prefer we track it as a separate improvement? |
|
Yes, I think adding a new fetch in the homepage is harmless. So please go ahead and add this. |
|
@dadiorchen and aanchaljain01 Could we fix the immediate bug by merging this now and then make future improvements? This has become project critical as we have a lot of users needing this feature now and it is not working. |
|
Yes working on it |
|
@dadiorchen and @Davidezrajay i am facing errors fixing the new improvements |
|
@aanchaljain01 let us try to fix your problem, sent message to you on slack |
def8957 to
61b38b3
Compare
Description
Added caching for the species list using @tanstack/react-query to improve performance and reduce unnecessary API calls.
Issue(s) addressed
What kind of change(s) does this PR introduce?
Please check if the PR fulfils these requirements
Issue
What is the current behavior?
The species list was fetched on every render without caching.
No spinner was visible during loading.
What is the new behavior?
Species list is cached for 5 minutes using react-query.
Spinner shows when data is loading.
Dropdown updates correctly from cached data.
Screen Recording 2025-09-02 at 10.28.52 AM.zip
Breaking change
Does this PR introduce a breaking change?
No
Other useful information
Further improvements can be made for approval functionality once clarified.