fix(testserver): report a silenced output, and rename the never-rendered status - #2494
Merged
Merged
Conversation
…red status `test_server()` could not see a `req()` failure: `set_silent()` left the test-mode record alone, so `get_output()` kept reporting the previous render's value with `status="ok"` while the browser blanked the output. `OutBoundMessageQueues` now records the suppression itself in `test_silent`, cleared as soon as the output computes a value or errors again. `test_values`/`test_errors` still keep the last computed value (Shiny for R parity), so the snapshot served over HTTP is unchanged. With silence observable, `"silent"` now means what Shiny already taught: this render produced nothing. The state it used to name -- an output that has not run at all -- is now `"never-rendered"`. Closes #2492, closes #2493
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.
Fixes both
test_server()status issues; they are coupled, since the second frees the name the first needs.#2492 — a silent
req()failure is invisibleset_silent()left the test-mode record untouched, soget_output()kept reporting the previous render's value withstatus="ok"while the browser blanked the output. A test could pass while asserting a value the user cannot see.OutBoundMessageQueuesnow records the suppression as its own fact intest_silent, discarded as soon as the output computes a value or errors again.test_values/test_errorsstill retain the last computed value (Shiny for R parity), so_build_test_snapshot()and the HTTP snapshot are unchanged — onlytest_serverreads the new set, the same way it already readstest_tracebacks.#2493 —
"silent"meant "never rendered"With silence observable,
"silent"now means what Shiny already taught: this render produced nothing. The state it used to name — an output that has not run at all — is"never-rendered".In practice most outputs that used to report
"silent"still do, because reading an unset input raises aSilentException."never-rendered"is the narrower state of an output whose effect never ran, e.g. a hidden (suspended) one.__eq__now has a distinct message per state;keys()/dict()/repr()treat both the same as before (novalue, noerror).No changelog entry:
test_server()is itself unreleased (#2470), so its documented behavior is just what ships.Verification
.venv/bin/python -m pytest tests/pytest -q→ 1208 passed, 1 skipped.uv run make format check-lint check-typesandmake check-pyrightclean. New tests cover the silenced-after-ok transition, thenever-renderedstate, and the queue-level clearing rules; the bundledshiny-for-pythonskill's status table is updated.