Repository navigation
fix(waves): close streaming socket when initial send fails - #151
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
|
crim doesn't review pull requests automatically here. Comment |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the first
ws.send()inWavesStreamingTTS.synthesize()raises after connecting, it runs outside the existingtry/finally. The socket remains open and the client retains its connected state.Move payload creation and the initial send into that existing cleanup block. Preserve the original exception and close the socket on this path, as the method already does for later streaming errors. The source and custom tests are already protected by
.fernignore.Two regression cases exercise
synthesize()through its public generator with a fake WebSocket transport, raisingConnectionResetErrorandRuntimeErrorfrom the initial send. Both fail before the change and pass afterward; they verify the same exception propagates, the socket closes once, and connection state clears.Validation: 266 offline custom tests passed, one skipped and three integration tests deselected (22 warnings); full Ruff lint, formatting (1,156 files), and mypy (1,101 source files) passed. No live API or real audio device was used. Tests use
--noconftestto avoid the global Docker/WireMock fixture, with telemetry disabled and API credentials empty. Developed with AI assistance and verified locally.Wheel and sdist builds passed. The static verification harness reports the existing analytics wire-coverage gap (9 tests for 18 methods), also reproduced on the original source; its live layers were skipped without credentials.