Skip to content

Commit fb79b18

Browse files
committed
More descriptive NEWS item and added an explanatory comment to the code
1 parent 3841f22 commit fb79b18

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ shiny 1.0.3.9000
1515

1616
### Bug fixes
1717

18-
* Fixed [#1546](https://github.com/rstudio/shiny/issues/1546): make it possible (without any hacks) to write arbitrary data into a module's `session$userData` (which is exactly the same environment as the parent's `session$userData`). ([#1732](https://github.com/rstudio/shiny/pull/1732)).
18+
* Fixed [#1546](https://github.com/rstudio/shiny/issues/1546): make it possible (without any hacks) to write arbitrary data into a module's `session$userData` (which is exactly the same environment as the parent's `session$userData`). To be clear, it allows something like `session$userData$x <- TRUE`, but not something like `session$userData <- TRUE` (that is not allowed in any context, whether you're in the main app, or in a module) ([#1732](https://github.com/rstudio/shiny/pull/1732)).
1919

2020
* Fixed [#1701](https://github.com/rstudio/shiny/issues/1701): There was a partial argument match in the `generateOptions` function. ([#1702](https://github.com/rstudio/shiny/pull/1702))
2121

R/modules.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ createSessionProxy <- function(parentSession, ...) {
2626

2727
#' @export
2828
`$<-.session_proxy` <- function(x, name, value) {
29+
# this line allows users to write into session$userData
30+
# (e.g. it allows something like `session$userData$x <- TRUE`,
31+
# but not `session$userData <- TRUE`) from within a module
32+
# without any hacks (see PR #1732)
2933
if (identical(x[[name]], value)) return(x)
3034
stop("Attempted to assign value on session proxy.")
3135
}

0 commit comments

Comments
 (0)