improve Run App url matching and fix preview timeout issue #5349
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.
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.The prerelease branch will need to be updated again to include the additional changes.
Addresses
Implementation Notes
URL Matching
appUrlStrings
to the run and debug app options, which we will attempt to extract the app url from{{APP_URL}}
, which indicates the location of the app url relative to the stringappUrlStrings
for each framework we support{{APP_URL}}
is found in the providedappUrlStrings
appUrlStrings
fails or noappUrlStrings
are found, we fallback to a more basic url match for strings that start with http or httpsShell Integration Warning Message
This PR should also fix a timing issue where the
didPreviewUrlTimeout
would time out beforeterminalOutputTimeout
, causing the shell integration warning message to show. We now setdidPreviewUrlTimeout
to be 5 seconds longer thanterminalOutputTimeout
, so that it doesn't timeout before the app preview is done.QA Notes
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 several times to check that the issue does not occur.