Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Bug fixes

* Fixed issue where apps run in Workbench were unexpectedly crashing. Apps in Workbench will now have `ws_per_message_deflate=False` enforced. (#2005)

* Fixed an issue where the `<main>` areas of `ui.page_sidebar()` and `ui.page_navbar()` (with a `sidebar`) were made to be a fillable containers even when `fillable=False`. (#1816)

* Fixed an issue where the `.update_user_input()` method on `ui.Chat()` isn't working in shinylive. (#1891)
Expand Down
16 changes: 16 additions & 0 deletions shiny/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import re
import sys
import types
import warnings
from pathlib import Path
from typing import Any, Optional

Expand All @@ -20,6 +21,7 @@

from . import __version__, _autoreload, _hostenv, _static, _utils
from ._docstring import no_example
from ._hostenv import is_workbench
from ._typing_extensions import NotRequired, TypedDict
from .bookmark._bookmark_state import shiny_bookmarks_folder_name
from .express import is_express_app
Expand Down Expand Up @@ -331,6 +333,9 @@ def run_app(

log_config: dict[str, Any] = copy.deepcopy(uvicorn.config.LOGGING_CONFIG)

# Workaround for nginx/uvicorn issue within Workbench
# https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088

if reload_dirs is None:
reload_dirs = []
if app_dir is not None:
Expand Down Expand Up @@ -399,6 +404,17 @@ def run_app(

maybe_setup_rsw_proxying(log_config)

if is_workbench() and kwargs.get("ws_per_message_deflate"):
# Workaround for nginx/uvicorn issue within Workbench
# https://github.com/rstudio/rstudio-pro/issues/7368#issuecomment-2918016088
warnings.warn(
"Overwriting kwarg 'ws_per_message_deflate'=True to False to avoid breaking issue in Workbench",
stacklevel=2,
)
kwargs["ws_per_message_deflate"] = False
elif is_workbench():
kwargs["ws_per_message_deflate"] = False

uvicorn.run( # pyright: ignore[reportUnknownMemberType]
app,
host=host,
Expand Down
Loading