dsuryd / dotNetify

Simple, lightweight, yet powerful way to build real-time web apps.
https://dotnetify.net
Other
1.17k stars 164 forks source link

The 5.4 version creates several Timeouts without cleaning up #322

Closed AlmostADev closed 1 year ago

AlmostADev commented 1 year ago

The 5.4 version creates several Timeouts without cleaning up

Recently in my team, we upgraded to version 5.4, and we saw that are several timeouts created each second pointing to some methods like loaded and update methods. I've downgraded to 5.3 and this issue is not happening.

This is running over a React application based on the 16.8.4 version.

imagen

dsuryd commented 1 year ago

It's correct that setTimeout was introduced in the below code to avoid a possible race condition involving the newly updated state. https://github.com/dsuryd/dotNetify/blob/a5b850a8715ecf2d68efe4da5061f212c6e76dff/DevApp/src/dotnetify/core/dotnetify-vm.ts#L230

That would explain why you're seeing it on the log. However, this should not be an issue.