mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-29 16:58:11 -05:00
The first of the included tests did not pass without the changes to Observable. The problem occurred when a function read a reactive value and then wrote it. Any dependents on the function would not receive any invalidations, then or ever after. The first problem was that the dirty state was unilaterally set to FALSE after the function finished executing, which might not be accurate if the function's newly created was invalidated during its own execution. Instead we set dirty state to FALSE before executing. But to prevent reentrant calls from thinking the cached value can be used, we add a .running field that is also consulted during getValue. The second problem was that Observable$getValue didn't register the dependent until after updateValue. That is a problem if updateValue creates *and* invalidates a context before returning. So now we register the dependent before calling updateValue.