-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve Run App url matching and fix preview timeout issue (#5349)
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. ### Addresses - #5197 - #5306 ### Implementation Notes #### URL Matching - 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 #### Shell Integration Warning Message 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. ### 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](https://github.com/posit-dev/qa-example-content/tree/main/workspaces/dash-py-example) several times to check that the issue does not occur.
- Loading branch information
1 parent
fbd8b46
commit 461485e
Showing
4 changed files
with
167 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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