Skip to content

Hotfix/v1.107 species cache#1138

Merged
dadiorchen merged 2 commits intoGreenstand:hotfix/v1.107from
aanchaljain01:hotfix/v1.107-species-cache
Sep 20, 2025
Merged

Hotfix/v1.107 species cache#1138
dadiorchen merged 2 commits intoGreenstand:hotfix/v1.107from
aanchaljain01:hotfix/v1.107-species-cache

Conversation

@aanchaljain01
Copy link
Copy Markdown
Contributor

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?

  • [!] Enhancement
  • Bug fix
  • Refactor

Please check if the PR fulfils these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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?

Breaking change

Does this PR introduce a breaking change?
No

Other useful information

Further improvements can be made for approval functionality once clarified.

@aanchaljain01 aanchaljain01 requested a review from a team as a code owner September 2, 2025 15:31
@dadiorchen dadiorchen changed the base branch from master to hotfix/v1.107 September 5, 2025 06:27
@dadiorchen
Copy link
Copy Markdown
Collaborator

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

@aanchaljain01
Copy link
Copy Markdown
Contributor Author

@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?

@dadiorchen
Copy link
Copy Markdown
Collaborator

Yes, I think adding a new fetch in the homepage is harmless. So please go ahead and add this.

@Davidezrajay
Copy link
Copy Markdown

@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.

@aanchaljain01
Copy link
Copy Markdown
Contributor Author

Yes working on it

@aanchaljain01
Copy link
Copy Markdown
Contributor Author

@dadiorchen and @Davidezrajay i am facing errors fixing the new improvements
could you merge the previous fixes with the cache and i will keep working on the new improvments

@dadiorchen
Copy link
Copy Markdown
Collaborator

@aanchaljain01 let us try to fix your problem, sent message to you on slack

@aanchaljain01 aanchaljain01 force-pushed the hotfix/v1.107-species-cache branch from def8957 to 61b38b3 Compare September 19, 2025 15:26
@dadiorchen dadiorchen merged commit 01189d8 into Greenstand:hotfix/v1.107 Sep 20, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add React Query to our admin panel

3 participants