boxyhq / saas-starter-kit

🔥 Enterprise SaaS Starter Kit - Kickstart your enterprise app development with the Next.js SaaS boilerplate 🚀
https://boxyhq.com/blog/enterprise-ready-saas-starter-kit
Apache License 2.0
3.22k stars 725 forks source link

Implement Data Refresh Mechanism in Next.js Application to Reflect Underlying Data Changes #1201

Open Musyonchez opened 5 months ago

Musyonchez commented 5 months ago

Currently, your Next.js application does not automatically refresh or re-render components when the underlying data changes. This can lead to a situation where the data displayed in the UI is outdated and does not reflect the current state of the data source.

This issue can be misleading for users, as they may be making decisions or taking actions based on outdated information. It can also lead to inconsistencies between different users' views of the data if they are accessing it at different times.

I propose that you implement a mechanism to refresh the data or re-render the affected components when changes to the underlying data occur. This could involve using a state management library, implementing a polling mechanism, or using websockets for real-time updates, depending on your application's needs and the nature of the data changes.

By implementing this change, you can ensure that the users UI always reflects the most current state of the data, leading to a more accurate and user-friendly application.

niwsa commented 5 months ago

@Musyonchez Thank you for reporting. Where exactly do you see this issue ?

Musyonchez commented 5 months ago

Like in some pages where the user performs an action like submit the underlining data may change such that the data the user is viewing on their screen is like old data and if someone does not understand that nextjs does not rerender its page may rerun an action without knowing it worked. Or have like success messages for every action to show it was done.