One language call to rule them all #994
Labels
kind/chore
Create a none user-story issue (chore, tech issue, backend issue)
status/draft
Status: When you create an issue before you have enough info to properly describe the issue.
Description
A recent bug in profile (where 1/3 of all calls to it fails) revealed an issue with our current use of profile calls, namely that our BFF make calls to profile to get the user's language every time text with language support is required.
That means fetching every time a search in resources is performed, profile is called; for every search in api; every fetching of service owners for the filter; etc…
Instead of calling profile in three separate occasions on a single page to essentially get the same information, maybe we should instead reuse the language code fetched when the home controller is called. Especially since the change in language cannot be done from our pages at the moment and will not happen that frequently anyway. This will hopefully reduce vulnerability of errors like the current one in profile and also improve performance.
Consideration for language switching: In the future, when we implement an option to change language on our site we need to refetch localized data. Using language as part of the RTK cache key will automatically trigger this refetch.
Suggested solution:
The text was updated successfully, but these errors were encountered: