GenieFramework / Stipple.jl

The reactive UI library for interactive data applications with pure Julia.
MIT License
321 stars 27 forks source link

fix diverging models in watcher and event channels #260

Closed hhaensel closed 7 months ago

hhaensel commented 7 months ago

The setup in Stipple is such that each client receives its own model and that model is connected via a channel. But different clients that use the same channel don't really use different models. Instead they are using only the latest model they write to and that they receive data from. The respective part of code is here.

(https://github.com/GenieFramework/Stipple.jl/blob/master/src/Stipple.jl#L533).

However, the event channel is not always updated to use the latest model due to the following condition

if ! Genie.Router.ischannel(Router.channelname(ch))

Unfortunately, this is not only critical for multi-clients but also in case of page reloading. After reloading the page the watchers act on the latest model, while events still act on an old model that does not receive the data updates. So the results are getting incoherent and unpredictable.

I propose to remove the condition to get rid of this problem.