Skip to content

Commit

Permalink
Fix #1013: flushReact should be called after app loads (#1503)
Browse files Browse the repository at this point in the history
* Fix #1013: flushReact should be called after app loads

* Add link to pull request
  • Loading branch information
jcheng5 authored and wch committed Dec 15, 2016
1 parent bcefd1f commit e0868ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Expand Up @@ -29,6 +29,8 @@ shiny 0.14.2.9000

* Fixed [#117](https://github.com/rstudio/shiny/issues/117): Reactive expressions now release references to cached values as soon as they are invalidated, potentially making those cached values eligible for garbage collection sooner. Previously, this would not occur until the next cached value was calculated and stored. ([#1504](https://github.com/rstudio/shiny/pull/1504/files))

* Fixed [#1013](https://github.com/rstudio/shiny/issues/1013): `flushReact` should be called after app loads. Observers set up outside of server functions were not running until after the first user connects. ([#1503](https://github.com/rstudio/shiny/pull/1503))

shiny 0.14.2
============

Expand Down
8 changes: 6 additions & 2 deletions R/server.R
Expand Up @@ -761,12 +761,16 @@ runApp <- function(appDir=getwd(),
# Top-level ..stacktraceoff..; matches with ..stacktraceon in observe(),
# reactive(), Callbacks$invoke(), and others
..stacktraceoff..(
captureStackTraces(
captureStackTraces({
# If any observers were created before runApp was called, this will make
# sure they run once the app starts. (Issue #1013)
scheduleFlush()

while (!.globals$stopped) {
serviceApp()
Sys.sleep(0.001)
}
)
})
)

if (isTRUE(.globals$reterror)) {
Expand Down

0 comments on commit e0868ba

Please sign in to comment.