-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Result block don't get updated properly #432
Comments
I have been playing around with this quite a bit and there is one thing that has me confused: If you start up the app as serve_workspace(
stack1 = new_stack(
new_dataset_block("BOD"),
new_select_block()
),
stack2 = new_stack(new_result_block("stack1"))
) the app is "broken". If you start up as serve_workspace(
stack1 = new_stack(
new_dataset_block("BOD"),
new_select_block("Time")
),
stack2 = new_stack(new_result_block("stack1"))
) we're all good. It seems like the validation failure in the first setting somehow "breaks the reactive chain" and this "breakage" is not cleared up after the issue is fixed. In either case, I do not understand why Lines 225 to 232 in 061ac78
in the latter case, but not the former case. In both, Adding to the confusion: If you go ahead and change the data (in "stack1"), you again have an "invalid" state (in the select block) but this time nothing breaks and as soon as the issue is resolved all works fine. |
Summary of findings with @nbenn:
obs$update_blk <- observeEvent(c(r_values(), in_dat(), is_prev_valid()),
{
# 1. upd blk,
if (inherits(blk(), "result_block")) browser()
b <- update_blk(
b = blk(),
value = r_values(),
is_srv = is_srv,
input = input,
data = in_dat()
)
blk(b)
log_debug("Updating block ", class(x)[[1]])
# 2. Update UI
update_ui(b = blk(), is_srv = is_srv, session = session, l_init = l_init)
log_debug("Updating UI of block ", class(x)[[1]])
# Validating
is_valid$block <- validate_block(blk())
is_valid$message <- attr(is_valid$block, "msg")
is_valid$fields <- attr(is_valid$block, "fields")
log_debug("Validating block ", class(x)[[1]])
},
priority = 1000
) We found that in the first case (first stack is invalid), observeEvent(
c(
get_block_vals(vals$blocks),
get_last_block_data(vals$blocks)()
),
{
vals$stack <- set_stack_blocks(
vals$stack,
get_block_vals(vals$blocks),
get_last_block_data(vals$blocks)
)
}
)
|
Our latest PR breaks the result block.
Steps to reproduce:
Output: data are not updated in the second stack. This will likely affect the join block too.
The text was updated successfully, but these errors were encountered: