Skip to content

Commit

Permalink
delay stamping filter and limit stamping information
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksander Chlebowski committed Oct 17, 2023
1 parent f999875 commit b38413a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@ init <- function(data,

teal.logger::log_system_info()

# Calculate app hash to ensure snapshot compatibility. See ?snapshot. Raw data must be extracted from environments.
hashables <- c(mget(names(formals(init))), call = match.call())
hashables$data <- lapply(hashables$data$get_datanames(), function(dn) {
try(hashables$data$get_dataset(dn)$get_raw_data(), silent = TRUE)
}) # `try` handles errors from remote data
hashables$filter <- as.list(hashables$filter, recursive = TRUE)
attr(filter, "app_id") <- rlang::hash(hashables)

if (inherits(modules, "teal_module")) {
modules <- list(modules)
}
Expand Down Expand Up @@ -172,6 +164,13 @@ init <- function(data,
# convert teal.slice::teal_slices to teal::teal_slices
filter <- as.teal_slices(as.list(filter))

# Calculate app hash to ensure snapshot compatibility. See ?snapshot. Raw data must be extracted from environments.
hashables <- mget(c("data", "modules"))
hashables$data <- lapply(hashables$data$get_datanames(), function(dn) {
try(hashables$data$get_dataset(dn)$get_raw_data(), silent = TRUE)
}) # `try` handles errors from remote data
attr(filter, "app_id") <- rlang::hash(hashables)

# check teal_slices
for (i in seq_along(filter)) {
dataname_i <- shiny::isolate(filter[[i]]$dataname)
Expand Down

0 comments on commit b38413a

Please sign in to comment.