Skip to content

Commit

Permalink
Merge pull request #2424 from rstudio/joe/bugfix/reactive-value-not-c…
Browse files Browse the repository at this point in the history
…hanging

Fix rstudio/reactlog#36: Changes to reactive values not displaying accurately
  • Loading branch information
schloerke committed May 8, 2019
2 parents e6c2133 + c2430cd commit d5ad7ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ shiny 1.3.2.9000
### Bug fixes

* Fixed [#2250](https://github.com/rstudio/shiny/issues/2250): `updateSliderInput()` now works with un-specified (or zero-length) `min`, `max`, and `value`. ([#2416](https://github.com/rstudio/shiny/pull/2416))

* Fixed [#2233](https://github.com/rstudio/shiny/issues/2233): `verbatimTextOutput()` produced wrapped text on Safari, but the text should not be wrapped. ([#2353](https://github.com/rstudio/shiny/pull/2353))

* Fixed [rstudio/reactlog#36](https://github.com/rstudio/reactlog/issues/36): Changes to reactive values not displaying accurately in reactlog. ([#2424](https://github.com/rstudio/shiny/pull/2424))

shiny 1.3.2
===========

Expand Down
31 changes: 14 additions & 17 deletions R/reactives.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,24 +395,21 @@ ReactiveValues <- R6Class(
# set the value for better logging
.values[[key]] <- value

if (key_exists) {
# key has been depended upon (can not happen if the key is being set)
if (isTRUE(.hasRetrieved$keys[[key]])) {
rLog$valueChangeKey(.reactId, key, value, domain)
keyReactId <- rLog$keyIdStr(.reactId, key)
rLog$invalidateStart(keyReactId, NULL, "other", domain)
on.exit(
rLog$invalidateEnd(keyReactId, NULL, "other", domain),
add = TRUE
)
}
# key has been depended upon
if (isTRUE(.hasRetrieved$keys[[key]])) {
rLog$valueChangeKey(.reactId, key, value, domain)
keyReactId <- rLog$keyIdStr(.reactId, key)
rLog$invalidateStart(keyReactId, NULL, "other", domain)
on.exit(
rLog$invalidateEnd(keyReactId, NULL, "other", domain),
add = TRUE
)
}

} else {
# only invalidate if there are deps
if (isTRUE(.hasRetrieved$names)) {
rLog$valueChangeNames(.reactId, ls(.values, all.names = TRUE), domain)
.namesDeps$invalidate()
}
# only invalidate if there are deps
if (!key_exists && isTRUE(.hasRetrieved$names)) {
rLog$valueChangeNames(.reactId, ls(.values, all.names = TRUE), domain)
.namesDeps$invalidate()
}

if (hidden) {
Expand Down

0 comments on commit d5ad7ee

Please sign in to comment.