Skip to content

Conversation

@aron
Copy link
Contributor

@aron aron commented May 2, 2024

This PR fixes two issues with passing the AbortController as a signal option to the replicate.run() method.

Firstly now extract the signal property from the run() options and do not pass on as part of the API body. The backend has recently started validating the body payload so this is now resulting as an API error. This fixes the issue reported in #249.

Secondly, we now call the onProgress handler with the terminal canceled prediction. Previously when aborting a run() request we were dropping the final canceled prediction object and calling the onProgress callback with a stale "processing" object.

I've updated the tests to verify both of these changes.

aron added 2 commits May 2, 2024 12:53
This prevents it being passed to the backend as part of the body. The
backend has recently started validating the body payload so this is now
resulting as an API error.

Fixes #249
Previously when aborting a `run()` request we were dropping the final
canceled prediction object and calling the `onProgress` callback with a
stale "processing" object.
@aron aron requested a review from mattt May 2, 2024 11:57
@aron aron merged commit 9c54b7e into main May 2, 2024
@aron aron deleted the fix-abort-signal#249 branch May 2, 2024 12:14
@mattt
Copy link
Contributor

mattt commented May 2, 2024

Nice. Thanks, @aron! Cutting a new patch release with this fix.

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.

4 participants