#How to implement Webview watchdog to detect and refresh unresponsive frontend?
1 messages · Page 1 of 1 (latest)
Hi @smoky sleet
I developed a cross-platform desktop app for Windows and Mac using Rust and Tauri implementing authentication, auto-updating, and other core functionalities
I think we can figure out that problem if we discuss together.
For example, if anything fails on the frontend and the js code stops or becomes too slow, it could be due to issues like the page overloading the RAM or CPU, or any unexpected errors.
I don’t think there is a one stop solution and it would depend on the front end framework you use. Like in react I would use a mix of error boundaries (https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary) , oncaughterror and a rust side command to reload the window.
That will handle uncaught errors but reloading like this could quickly leave you in an infinite loop
Yeah, but this question is more related to Rust, by the way. So, I'm looking for a way to try to recover the app from the backend.
To eliminate the possibility of an infinite loop, the refresh can run for a limited time after being triggered, so it's not a big deal.
The main issue isn’t the errors themselves; there are other reasons to restart the webview, as I mentioned before.
I haven't been able to find a way to refresh the webview from Rust yet. Perhaps you know how this can be done?