Skip to content
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

set_workspace should iteratively call add_workspace_stack #437

Open
DivadNojnarg opened this issue Oct 16, 2024 · 1 comment
Open

set_workspace should iteratively call add_workspace_stack #437

DivadNojnarg opened this issue Oct 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@DivadNojnarg
Copy link
Collaborator

Discussed with @nbenn.

This issues does not seems to have "bad" consequences as it is corrected once shiny takes the lead. However, I believe it does not cost much to fix this.

Currently when we call set_workspace, the list of stacks is only returned at the end. As a result, if there is any result block within a second stack, it has no idea of the first stack, which yields a wrong value at initialisation (corrected by shiny later).

Since we have add_workspace_stack available and we rarely use it, set_workspace could just iterate over the passed elements and add the stacks one by one with add_workspace_stack.

@DivadNojnarg DivadNojnarg added the enhancement New feature or request label Oct 16, 2024
@nbenn
Copy link
Collaborator

nbenn commented Oct 21, 2024

@DivadNojnarg tbh, I don't think addressing this is worthwhile. You would be able to introduce a fix for a situation like

serve_workspace(
  stack1 = new_stack(new_dataset_block()),
  stack2 = new_stack(new_result_block())
)

In that you have "consistency" at the moment of instantiating the result block and not only after the first post-init update round, but this depends on the order of arguments. For a call as

serve_workspace(
  stack1 = new_stack(new_result_block()),
  stack2 = new_stack(new_dataset_block())
)

you're back to square one. In order to really make this work, we'd need to analyze dependencies, topo-sort stacks, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants