diff --git a/NEWS.md b/NEWS.md index 6f7164f421..284f0fd9d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -50,6 +50,8 @@ in shiny apps. For more info, see the documentation (`?updateQueryString` and `? * Fixed [#1605](https://github.com/rstudio/shiny/issues/1605): sliders did not move when clicked on the bar area. ([#1610](https://github.com/rstudio/shiny/pull/1610)) +* Fixed [#1621](https://github.com/rstudio/shiny/issues/1621): if a `reactiveTimer`'s session was closed before the first time that the `reactiveTimer` fired, then the `reactiveTimer` would not get cleared and would keep firing indefinitely. ([#1623](https://github.com/rstudio/shiny/pull/1623)) + ### Library updates * Closed [#1500](https://github.com/rstudio/shiny/issues/1500): Updated ion.rangeSlider to 2.1.6. ([#1540](https://github.com/rstudio/shiny/pull/1540)) diff --git a/R/reactives.R b/R/reactives.R index 51a7100a13..8ccea85dd2 100644 --- a/R/reactives.R +++ b/R/reactives.R @@ -1151,6 +1151,10 @@ setAutoflush <- local({ #' } #' @export reactiveTimer <- function(intervalMs=1000, session = getDefaultReactiveDomain()) { + # Need to make sure that session is resolved at creation, not when the + # callback below is fired (see #1614). + force(session) + dependents <- Map$new() timerCallbacks$schedule(intervalMs, function() { # Quit if the session is closed