Skip to content

Commit

Permalink
Make sure reactiveTimer gets session at creation time. Fixes #1621
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Mar 24, 2017
1 parent 00ab868 commit 52643f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions R/reactives.R
Expand Up @@ -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
Expand Down

0 comments on commit 52643f0

Please sign in to comment.