Skip to content

Conversation

jackyzha0
Copy link
Member

Why

const res = await someAsyncCall();
if (!res.ok) {
  resWritable.write(envRes);
  resWritable.close();

  return;
}

we see this pattern a lot in server-side streams and is verbose and prone to accidentally writing to a closed writable (e.g. if proc was cancelled mid someAsyncCall)

What changed

const res = await someAsyncCall();
if (!res.ok) {
  return resWritable.close(envRes);
}

Versioning

  • Breaking protocol change
  • Breaking ts/js API change

@jackyzha0 jackyzha0 requested a review from a team as a code owner September 26, 2025 22:04
@jackyzha0 jackyzha0 requested review from Monkatraz and removed request for a team September 26, 2025 22:04
@@ -1,7 +1,5 @@
# River

⚠️ Not production ready, while Replit is using parts of River in production, we are still going through rapid breaking changes. First production ready version will be `1.x.x` ⚠️
Copy link

Choose a reason for hiding this comment

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

pog

@jackyzha0 jackyzha0 merged commit 28b7276 into main Sep 26, 2025
9 checks passed
@jackyzha0 jackyzha0 deleted the jackyzha0/close-with-value branch September 26, 2025 22:17
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.

2 participants