Skip to content

fix(admin): improve refreshing of data for all cached components

Bc. Jakub Hejda requested to merge hejda/STR-1218/cache_service_fix into main

Description

fix(admin): improve refreshing of data for all cached components

  • There was a bug for cached components, that when some cached component should be restored from cache, data for all cached components have been refreshed. It was causing unnecessary backend requests.
  • Another related issue was that even the same component was able to be cached multiple times (only the newest component was stored in the cache, but all old components that were not restored stayed undestroyed in the background and all the the subscriptions for cache service were still active). Due to this issue also the same request could be executed several times during each restoration from the cache.
  • Now only the sufficient methods are executed during the restore process of the given component and they are executed only once.

How to test

  1. visit two or three cached pages several times (e.g. vo members, vo groups, vo application form)

  2. go to the detail (concrete group/member or app form preview)

  3. clear network tab

  4. click on the back button

On the main branch, you will see several backend requests, not just for the given component, but also for all other cached components (again multiple requests for them).

With this MR you will see just the correct request and only once.

Author's checklist

  • I have followed the contribution guidelines
  • This MR has been tested or does not change functionality
  • I have added relevant merge request dependencies (if this MR has any)
  • I have added the correct labels
  • I have assigned reviewers (if any are relevant)
  • I have edited the documentation (if the changes require it) or I have noted the need for the change if I do not have access to the documentation
  • I have marked all introduced BREAKING CHANGES or necessary DEPLOYMENT NOTES in the commit message(s)

Reviewer's checklist

  • This MR has been tested or does not change functionality
  • This MR has correct commit message format

Other information

None

Related issues

Closes STR-1218

Edited by Šárka Palkovičová

Merge request reports