Skip to content

Commit 01a9b0c

Browse files
feat: Revert broken finished SSE yield config
1 parent fbe853f commit 01a9b0c

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-573d364768ac1902ee5ed8b2485d3b293bda0ea8ff7898aef1a3fd6be79b594a.yml
33
openapi_spec_hash: 107ec840f4330885dd2232a05a66fed7
4-
config_hash: ab1c1122e862f9bdb6db4df36d489701
4+
config_hash: 0209737a4ab2a71afececb0ff7459998

src/SSEStream.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ private function parsedGenerator(): \Generator
2929
return;
3030
}
3131

32+
$done = false;
3233
foreach ($this->stream as $row) {
34+
// @phpstan-ignore if.alwaysFalse
35+
if ($done) {
36+
// Iterate through the whole stream
37+
continue;
38+
}
39+
3340
switch ($row['event'] ?? null) {
3441
case null:
3542
if ($data = $row['data'] ?? '') {
@@ -43,9 +50,7 @@ private function parsedGenerator(): \Generator
4350

4451
if ($data = $row['data'] ?? '') {
4552
if (str_starts_with($data, needle: '{"data":{"status":"finished"')) {
46-
$decoded = Util::decodeJson($data);
47-
48-
yield Conversion::coerce($this->convert, value: $decoded);
53+
$done = true;
4954

5055
continue;
5156
}

0 commit comments

Comments
 (0)