Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix improve Run App url matching and fix preview timeout issue #5362

Open
wants to merge 2 commits into
base: prerelease/2024.11
Choose a base branch
from

Conversation

Cherry-picks #5336 to bring
the fix from the 2024.11 patch branch to the `main` branch. The below
description is copied from #5336 and modified to remove the AppUrlString
type changes due to conflicts with Prettier.

The prerelease branch will need to be updated again to include the
additional changes.

- #5197
- #5306

- introduces `appUrlStrings` to the run and debug app options, which we
will attempt to extract the app url from
- the strings should contain the placeholder `{{APP_URL}}`, which
indicates the location of the app url relative to the string
- adds the appropriate `appUrlStrings` for each framework we support
- expands on our url matching by:
- attempting to match url-like text where `{{APP_URL}}` is found in the
provided `appUrlStrings`
- if matching against `appUrlStrings` fails or no `appUrlStrings` are
found, we fallback to a more basic url match for strings that start with
http or https

This PR should also fix a timing issue where the `didPreviewUrlTimeout`
would time out before `terminalOutputTimeout`, causing the shell
integration warning message to show. We now set `didPreviewUrlTimeout`
to be 5 seconds longer than `terminalOutputTimeout`, so that it doesn't
timeout before the app preview is done.

This PR fixes Run App in Terminal url detection for non-local URLs. One
way to get a non-local url is by running the `shiny-py-example` in
Positron on Workbench (see #5197).

Other app types like Dash, Streamlit, Fastapi, Flask and Gradio should
continue to work on Desktop, Server Web and Positron on Workbench.

This PR should also fix the issue seen in #5306, which can be tested by
running the [Dash Py Example](https://github.com/posit-dev/qa-example-content/tree/main/workspaces/dash-py-example) several times to check that the issue does not occur.
…-run-app-improve-url-matching-additional-fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant