Detach generate_plugin_args() output from its testServer session#198
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
32aab09 to
d98dda3
Compare
shiny's upcoming module-scoped reactive cleanup tears down session-scoped reactives when testServer() closes, which would break callers that read the returned plugin args afterwards (issue #196). Re-create the reactive parts on a NULL reactive domain, preserving reactiveValues/reactiveVal types so downstream uses such as blockr.dock's reactiveValuesToList(server$cond) keep working. Errors from not-yet-evaluable reactives are deferred to read time, as the live reactive would have raised them.
d98dda3 to
6d58f9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
testServer()closes.generate_plugin_args()returned the board's livereactiveValues(and the nested block reactives), so callers that read them after the helper returns will hit "its module session has been destroyed."NULLreactive domain (new internalsnapshot_reactives()), so they outlive the setup session — the issue's snapshot suggestion combined with itswithReactiveDomain(NULL, …)mechanism, applied in the helper rather than in the productionboard_server().reactiveValuesstaysreactiveValues, not plain data):blockr.dockreadsserver$condviareactiveValuesToList(), which the literalisolate(reactiveValuesToList(rv))suggestion would break.I also ran the downstream consumers of this helper (
blockr.code,blockr.dock'sboard_argstests) against the patched core; both stay green.Fixes #196