Skip to content

Heads-up: shiny session cleanup affects generate_plugin_args() tests (temporarily deferred for 1.14.0) #196

Closed

Description

@cpsievert

Hi! A heads-up from the shiny team, and some context since parts of this are still in flight.

In shiny's upcoming 1.14.0 we added module-scoped reactive cleanup (rstudio/shiny#4372): reactives created during a session are torn down when that session closes. Your exported test helper generate_plugin_args() (R/utils-tests.R) runs board_server inside testServer() and returns the board's live reactiveValues (rv, via make_read_only()), which callers then read after the block (e.g. test-utils-code.R, test-plugin-code.R read …$board via isolate()). Once testServer() closes the session, those reads error with "its module session has been destroyed."

Nothing is required for 1.14.0. We've temporarily disabled this cleanup inside testServer() for the release so your current tests keep passing — see rstudio/shiny#4396. We expect to re-enable it in a later release (timing still open), so we wanted to give you runway.

A few directions, depending on what fits your design:

  1. Snapshot before returning (smallest change): return plain data instead of live handles, e.g. isolate(reactiveValuesToList(rv)) — good if callers only inspect values.
  2. Assert inside the testServer() block, where the session is still alive.
  3. If board state is meant to outlive any single session, create it session-independently with withReactiveDomain(NULL, …) at R/board-server.R:60 — though that opts board reactivity out of shiny's module-destroy cleanup, so only if it matches the intended lifecycle.

We haven't locked down the final shiny behavior, so if none of these feel right for blockr's architecture, that's useful signal for us — happy to talk it through.

Activity

  1. nbenn commented on Jun 4, 2026

    @nbenn
    Collaborator

    @cpsievert many thanks for the heads-up here. I'll look into fixing. Also: many thanks for your work on having shiny handle module cleanup. We have built out infrastructure here using non-API logic to do this ourselves. This can now be removed, which is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions