Skip to content
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

(feat) O3-4277: Enable app-specific SWRConfig #1253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Twiineenock
Copy link
Contributor

@Twiineenock Twiineenock commented Dec 30, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. Ensure your PR title includes a conventional commit label (such as feat, fix, or chore, among others). See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.

Summary

Description

Work in this PR allows app-specific SWR configurations for example the service queues and ward apps, ensuring their data refresh rates align with their real-time requirements.

Background

Both the service queues and ward apps are used to display near real-time dashboards for OPD/IPD workflows. A recent global configuration change in the SWR library increased the default data cache time to 30 minutes. While this change optimizes performance for many apps, it is not suitable for apps requiring more frequent updates.

Screenshots

Related Issue

https://openmrs.atlassian.net/browse/O3-4277

Other

@Twiineenock
Copy link
Contributor Author

CC
@chibongho , @brandones, @denniskigen

Copy link
Contributor

@chibongho chibongho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Twiineenock . I think we should be able to have app-specific SWRConfig without changes to core. I'm thinking of just wrapping the root component in root.comonent.tsx (in the ward app and the service queues app) with <SWRConfig>.

Copy link
Collaborator

@brandones brandones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support this change. Doing it this way has two advantages:

  1. We can merge custom SWR config options with our application default options
  2. We avoid creating extra nested SWRConfig contexts

Maybe @ibacher or @denniskigen can weigh in, since @chibongho and I are at odds here?

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.

3 participants