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

check for appReadyMessage before previewing app #5265

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Nov 4, 2024

Implementation Notes

  • adds optional appReadyMessage property to RunAppOptions and DebugAppOptions
  • specify an appReadyMessage of 'Application startup complete' for FastAPI and Shiny apps, which leverage uvicorn and output that message when the app is ready
  • delete empty DebugConfiguration object from the positron-run-app.d.ts files, as I think they are unused?
  • modified the logging level in api.ts for a few messages
  • previewUrlInExecutionOutput now checks for both the app url and the appReadyMessage if provided,
    • an app is considered ready if:
      • the appReadyMessage was not provided and the app url has been matched; or
      • the appReadyMessage was provided and matched, and the app url has been matched
    • if the appReadyMessage was provided but not matched, and the app url has been matched, we'll time out of the raceTimeout, but the url will have been matched, so we'll still try to open the app in the Viewer

QA Notes

For apps that may output the server url before the app is ready, we need to check for the appReadyMessage before previewing the app.

Otherwise, the preview may fail because the app server is not ready to serve the app when the preview is requested.

In testing, fastapi apps were sometimes being previewed before the app was ready to serve the app.
@sharon-wang sharon-wang marked this pull request as ready for review November 4, 2024 22:30
@sharon-wang sharon-wang requested a review from seeM November 4, 2024 22:30
Copy link
Contributor

@seeM seeM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well locally in my testing and the approach makes sense to me!

@sharon-wang sharon-wang merged commit 106ec35 into main Nov 6, 2024
17 of 23 checks passed
@sharon-wang sharon-wang deleted the run-app-check-appReadyMessage branch November 6, 2024 14:52
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants