mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 23:48:01 -05:00
Compare commits
5 Commits
py-shiny
...
joe/bugfix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfc45b45f6 | ||
|
|
e4d0045183 | ||
|
|
f076763778 | ||
|
|
1919ccb1fa | ||
|
|
c3b0dcb8a6 |
4
NEWS.md
4
NEWS.md
@@ -43,7 +43,9 @@ shiny development
|
||||
|
||||
* Closed rstudio/shinytest2#222: When restoring a context (i.e., bookmarking) from a URL, Shiny now better handles a trailing `=` after `_inputs_` and `_values_`. (#3648)
|
||||
|
||||
* Closed #3581: Errors in throttled/debounced reactive expressions cause session to exit. (#3624)
|
||||
* Closed #3581: Errors in throttled/debounced reactive expressions no longer cause the session to exit. (#3624)
|
||||
|
||||
* Closed #3250:`{rlang}`/`{tidyeval}` conditions (i.e., warnings and errors) are no longer filtered from stack traces. (#3602)
|
||||
|
||||
|
||||
shiny 1.7.1
|
||||
|
||||
@@ -421,8 +421,17 @@ pruneStackTrace <- function(parents) {
|
||||
# Loop over the parent indices. Anything that is not parented by current_node
|
||||
# (a.k.a. last-known-good node), or is a dupe, can be discarded. Anything that
|
||||
# is kept becomes the new current_node.
|
||||
#
|
||||
# jcheng 2022-03-18: Two more reasons a node can be kept:
|
||||
# 1. parent is 0
|
||||
# 2. parent is i
|
||||
# Not sure why either of these situations happen, but they're common when
|
||||
# interacting with rlang/dplyr errors. See issue rstudio/shiny#3250 for repro
|
||||
# cases.
|
||||
include <- vapply(seq_along(parents), function(i) {
|
||||
if (!is_dupe[[i]] && parents[[i]] == current_node) {
|
||||
if ((!is_dupe[[i]] && parents[[i]] == current_node) ||
|
||||
parents[[i]] == 0 ||
|
||||
parents[[i]] == i) {
|
||||
current_node <<- i
|
||||
TRUE
|
||||
} else {
|
||||
|
||||
@@ -1,30 +1,33 @@
|
||||
capture <- function() {
|
||||
list(
|
||||
calls = sys.calls(),
|
||||
parents = sys.parents()
|
||||
foo <- function() {
|
||||
capture <- function() {
|
||||
list(
|
||||
calls = sys.calls(),
|
||||
parents = sys.parents()
|
||||
)
|
||||
}
|
||||
|
||||
capture_1 <- function() {
|
||||
capture()
|
||||
}
|
||||
|
||||
capture_2 <- function() {
|
||||
capture_1()
|
||||
}
|
||||
|
||||
do.call(
|
||||
identity,
|
||||
list(
|
||||
identity(capture_2())
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
capture_1 <- function() {
|
||||
capture()
|
||||
}
|
||||
|
||||
capture_2 <- function() {
|
||||
capture_1()
|
||||
}
|
||||
|
||||
res <- do.call(
|
||||
identity,
|
||||
list(
|
||||
identity(capture_2())
|
||||
)
|
||||
)
|
||||
res$calls <- tail(res$calls, 5)
|
||||
res$parents <- tail(res$parents - (length(res$parents) - 5), 5)
|
||||
res <- foo()
|
||||
res$calls <- tail(res$calls, 6)
|
||||
res$parents <- tail(res$parents - (length(res$parents) - 6), 6)
|
||||
|
||||
describe("stack pruning", {
|
||||
it("passes basic example", {
|
||||
expect_equal(pruneStackTrace(res$parents), c(F, F, T, T, T))
|
||||
expect_equal(lapply(list(res$parents), pruneStackTrace), list(c(F, F, T, T, T)))
|
||||
expect_equal(pruneStackTrace(res$parents), c(T, F, F, T, T, T))
|
||||
expect_equal(lapply(list(res$parents), pruneStackTrace), list(c(T, F, F, T, T, T)))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user