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

Ensure JS client status_callback functionality works and improve status messages #8699

Merged
merged 9 commits into from
Jul 8, 2024

Conversation

hannahblair
Copy link
Collaborator

@hannahblair hannahblair commented Jul 3, 2024

Description

This PR ensures the handle_space_success function is bound to the Client class, and that the logic is reached. I've also improved the messaging of the statuses so it doesn't show a generic error for a building or starting status.

To test:

await Client.connect("gradio/event_trigger", {
    status_callback: (space_status) =>
    console.log("Status updated: ", space_status)
});

Feel free to use or clone this sandbox to test (just download the tarfile for this PR and replace the .tgz and references to it in that sandbox).

Closes: #8695

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

* ensure status callbacks work correctly
@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jul 3, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/9155f4acf750b98d36aca5d1016e6ccb5e6e81c1/gradio-4.37.2-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@9155f4acf750b98d36aca5d1016e6ccb5e6e81c1#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/9155f4acf750b98d36aca5d1016e6ccb5e6e81c1/gradio-client-1.2.1.tgz

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jul 3, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/client patch
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Ensure JS client status_callback functionality works and improve status messages

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@hannahblair hannahblair requested a review from pngwn July 4, 2024 14:19
@abidlabs abidlabs requested a review from aliabid94 July 7, 2024 14:16
Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for fixing this @hannahblair!

@hannahblair hannahblair merged commit 012da05 into main Jul 8, 2024
7 checks passed
@hannahblair hannahblair deleted the client-space-success branch July 8, 2024 11:01
@pngwn pngwn mentioned this pull request Jul 8, 2024
dawoodkhan82 pushed a commit that referenced this pull request Jul 10, 2024
…atus messages (#8699)

* * bind handle_space_success
* ensure status callbacks work correctly

* add changeset

* test fixes + refactor

* tweak

* test

* Revert "test"

This reverts commit db1afc4.

---------

Co-authored-by: gradio-pr-bot <[email protected]>
dawoodkhan82 added a commit that referenced this pull request Jul 11, 2024
* latex fix

* format

* add changeset

* fix demo (#8696)

* Better spacing for codeblocks on docs (#8686)

* styling for codeblocks

* add changeset

* formatting

* add changeset

* changes

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>

* Add search to website (#8624)

* Update action.yml (#8702)

* Model3D point cloud and wireframe display modes (#8687)

* display modes

* add changeset

* test fixes

* lint

* Update gradio/components/model3d.py

Co-authored-by: Abubakar Abid <[email protected]>

* solid

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>

* Fix playground to display errors (#8689)

* Fix the Playground on the website to trigger run_code() and install() with debounce and to display errors

* Remove an unused function, make_full_screen()

* Format demo/hello_world/run.py

* Update notebook

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environme… (#8705)

* GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environment variables

* GRADIO_ALLOWED_PATHS & GRADIO_BLOCKED_PATHS comma separated environment variables

* add changeset

* Document GRADIO_ALLOWED_PATHS and GRADIO_BLOCKED_PATHS

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>

* Ensure JS client `status_callback` functionality works and improve status messages (#8699)

* * bind handle_space_success
* ensure status callbacks work correctly

* add changeset

* test fixes + refactor

* tweak

* test

* Revert "test"

This reverts commit db1afc4.

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Documents auth in the guides, in the view API page, and also types the Blocks.config object  (#8720)

* auth docs

* changes

* add changeset

* add changeset

* add changeset

* type

* changes

* snippets

* import

* add changeset

* changes

* fix typing

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* remove on mount

* merge

* remove onmount

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: pngwn <[email protected]>
Co-authored-by: Ali Abdalla <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: Yuichiro Tachibana (Tsuchiya) <[email protected]>
Co-authored-by: cocktailpeanut <[email protected]>
Co-authored-by: Hannah <[email protected]>
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.

handle_space_success is not bound properly in JS client
3 participants