Bug? Refresh function fires twice on DB changes (video included)

Im wondering if anybody has experienced this before. I make 1 change to the DB. i have those data bound to a plugin element’s refresh function. when those data change, the refresh function fires twice most of the time. is this a known bug or am i maybe doing something incorrectly?

the Refresh function is firing twice or more sometimes on DB changes for bound data. check out the video

Could it be due to data filtering? The element fires refresh when it gets data but then once again after the data’s filtered?

Yep, weird issue but I see the same thing on my plugins. Will routinely fire off 2 or more times.

Any idea what causes this?

I’m gonna do some debugging but it’s certainly weird. Thanks for chiming info btw!

What’s most weird is it doesn’t happen in all plugins I think

I’m not sure what causes it. It doesn’t typically cause a major issue. Please let me know if you figure it out though!

1 Like

Would be curious if late loading data might be a cause since that would technically be a ‘change’. If so it would make sense that the update function on a plugin that does not use dynamic data may not be triggered multiple times.

1 Like

The only thing I can think is that I am calling some bound data properties at both the beginning and then others at the point right the update function fires a second time.

I’ll try to get a screen grab of what I mean. I think you may be on to something.

So, calling properties.variablename.length() in a conditional was causing the issue. I grab all data at the beginning of the update function now instead of lazily adding it in later. that works much better. All data is grabbed at once so there isn’t a too many milliseconds later data grab (50-100 lines or so later). Seems like this should be cached since it had just got called the line above for a console.log() but idk moving it stops the weird behavior though it still fires a couple times, it is not longer visible. idk not fixed and still weird but better.

1 Like