Context
I'm part of the team that develops the DaVinci modular ecosystem (think "Teal" except with a focus on data exploration rather than reporting).
Many of our modules have such a regular interface that we can describe their parameters semantically and generate UIs on the fly to configure them. Here's an example of how we can configure a lineplot display:

The left menu allows to configure the module through a point-and-click interface. The top-right section shows the equivalent code. The bottom-right section is the actual interface of the module as it will be displayed in the final application.
This app works by re-running the target module every time one of the left menu parameters changes. This is far from trivial due to leftover observers in the target module, which led us to develop an observer_dedup routine that works as advertised but relies on undocumented shiny internals. As you can imagine, we were very happy to see the work you've put in the recent ability to destroy reactive state feature.
Problem
The problem we're facing is that session$destroy() will remove all server side inputs regardless of whether they were introduced dynamically (renderUI/insertUI) or declared statically as part of the UI of the application. This means that a hypothetical static UI selectInput(ns('id'), ...) that defaults to its first option will no longer be available upon reload and any reactive that depends on input[['id']] will just fail until the user interacts with the selector.
At first glance this issue looks like just an ergonomic loss, but the impact that it has on the feedback loop of the users of this tool is severe. When you know that the target module will be in an error state after every parameter change, you think twice before touching anything. We would prefer our users to stay in a curious, playful state of mind.
We could rewrite all of our modules to avoid statically defined inputs, but we believe this issue hurts the usefulness session$destroy(), so we've decided to run our use case by you first and maybe save ourselves the trouble.
Request
- Would it be possible for
session@destroy() to spare the server-side representation of statically defined inputs?
There are other formulas that would work for us. We would also be equally happy if the state of all inputs was preserved, perhaps conditional to an extra flag passed to session$destroy (e.g. session$destroy(id, preserve_input_state=TRUE)).
Thanks for considering our request!
Context
I'm part of the team that develops the DaVinci modular ecosystem (think "Teal" except with a focus on data exploration rather than reporting).
Many of our modules have such a regular interface that we can describe their parameters semantically and generate UIs on the fly to configure them. Here's an example of how we can configure a lineplot display:

The left menu allows to configure the module through a point-and-click interface. The top-right section shows the equivalent code. The bottom-right section is the actual interface of the module as it will be displayed in the final application.
This app works by re-running the target module every time one of the left menu parameters changes. This is far from trivial due to leftover observers in the target module, which led us to develop an observer_dedup routine that works as advertised but relies on undocumented shiny internals. As you can imagine, we were very happy to see the work you've put in the recent ability to destroy reactive state feature.
Problem
The problem we're facing is that
session$destroy()will remove all server side inputs regardless of whether they were introduced dynamically (renderUI/insertUI) or declared statically as part of the UI of the application. This means that a hypothetical static UIselectInput(ns('id'), ...)that defaults to its first option will no longer be available upon reload and any reactive that depends oninput[['id']]will just fail until the user interacts with the selector.At first glance this issue looks like just an ergonomic loss, but the impact that it has on the feedback loop of the users of this tool is severe. When you know that the target module will be in an error state after every parameter change, you think twice before touching anything. We would prefer our users to stay in a curious, playful state of mind.
We could rewrite all of our modules to avoid statically defined inputs, but we believe this issue hurts the usefulness
session$destroy(), so we've decided to run our use case by you first and maybe save ourselves the trouble.Request
session@destroy()to spare the server-side representation of statically defined inputs?There are other formulas that would work for us. We would also be equally happy if the state of all inputs was preserved, perhaps conditional to an extra flag passed to
session$destroy(e.g.session$destroy(id, preserve_input_state=TRUE)).Thanks for considering our request!