From 8a0731493fa2daa55ac497f4c454e98ca2db5923 Mon Sep 17 00:00:00 2001 From: Joe Cheng Date: Tue, 7 May 2019 09:30:35 -0700 Subject: [PATCH 1/2] Fix rstudio/reactlog#36: Changes to reactive values not displaying accurately --- R/reactives.R | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/R/reactives.R b/R/reactives.R index e2164c23e9..c1e2e18720 100644 --- a/R/reactives.R +++ b/R/reactives.R @@ -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) { From c2430cd3f477615f585b41d137a270f37fca1cbc Mon Sep 17 00:00:00 2001 From: Joe Cheng Date: Tue, 7 May 2019 09:33:59 -0700 Subject: [PATCH 2/2] Update NEWS --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index fd7c2e30ca..e3eecd5607 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 ===========