From b38413a005e19925ca3b2b915b45b543fc50dc9b Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski Date: Tue, 17 Oct 2023 15:43:55 +0200 Subject: [PATCH] delay stamping filter and limit stamping information --- R/init.R | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/R/init.R b/R/init.R index 301d19ab02..37a1f95d12 100644 --- a/R/init.R +++ b/R/init.R @@ -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) } @@ -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)