[XS] Change in dart/sdk[main]: Clarify WebSocket.addError behavior

0 views
Skip to first unread message

Yash Hosalli (Gerrit)

unread,
May 10, 2026, 3:11:03 PM (3 days ago) May 10
to Samuel Rawlins, Hangyu Jin, rev...@dartlang.org
Attention needed from Hangyu Jin and Samuel Rawlins

Yash Hosalli added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Yash Hosalli . resolved

This CL adds documentation for `WebSocket.addError` to clarify that it does not transmit error events to the remote peer and only reports them locally.

The change addresses confusion described in dart-lang/sdk#45733.

Open in Gerrit

Related details

Attention is currently required from:
  • Hangyu Jin
  • Samuel Rawlins
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8913ac4fb466e9d613b3f0c5f0727640c9d9a913
Gerrit-Change-Number: 502500
Gerrit-PatchSet: 1
Gerrit-Owner: Yash Hosalli <hosal...@gmail.com>
Gerrit-Reviewer: Hangyu Jin <jinh...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Hangyu Jin <jinh...@google.com>
Gerrit-Attention: Samuel Rawlins <sraw...@google.com>
Gerrit-Comment-Date: Sun, 10 May 2026 19:10:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Samuel Rawlins (Gerrit)

unread,
May 10, 2026, 9:57:04 PM (2 days ago) May 10
to Yash Hosalli, Brian Quinlan, Hangyu Jin, rev...@dartlang.org
Attention needed from Hangyu Jin and Yash Hosalli

Samuel Rawlins voted and added 1 comment

Votes added by Samuel Rawlins

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Samuel Rawlins . resolved

Thanks for the fix! @bqui...@google.com is a good reviewer for this.

Open in Gerrit

Related details

Attention is currently required from:
  • Hangyu Jin
  • Yash Hosalli
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8913ac4fb466e9d613b3f0c5f0727640c9d9a913
Gerrit-Change-Number: 502500
Gerrit-PatchSet: 2
Gerrit-Owner: Yash Hosalli <hosal...@gmail.com>
Gerrit-Reviewer: Hangyu Jin <jinh...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-CC: Brian Quinlan <bqui...@google.com>
Gerrit-Attention: Hangyu Jin <jinh...@google.com>
Gerrit-Attention: Yash Hosalli <hosal...@gmail.com>
Gerrit-Comment-Date: Mon, 11 May 2026 01:57:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Brian Quinlan (Gerrit)

unread,
May 12, 2026, 3:31:11 PM (18 hours ago) May 12
to Yash Hosalli, dart-...@luci-project-accounts.iam.gserviceaccount.com, Samuel Rawlins, Hangyu Jin, rev...@dartlang.org
Attention needed from Hangyu Jin and Yash Hosalli

Brian Quinlan added 2 comments

Patchset-level comments
Brian Quinlan . resolved

Nice clarification!

File sdk/lib/_http/websocket.dart
Line 442, Patchset 2 (Latest): /// The error is reported locally and is not transmitted to the peer.
Brian Quinlan . unresolved

What does this mean exactly? How does the error get reported? Do we have a test for this that you could point me to?

Open in Gerrit

Related details

Attention is currently required from:
  • Hangyu Jin
  • Yash Hosalli
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8913ac4fb466e9d613b3f0c5f0727640c9d9a913
Gerrit-Change-Number: 502500
Gerrit-PatchSet: 2
Gerrit-Owner: Yash Hosalli <hosal...@gmail.com>
Gerrit-Reviewer: Brian Quinlan <bqui...@google.com>
Gerrit-Reviewer: Hangyu Jin <jinh...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Hangyu Jin <jinh...@google.com>
Gerrit-Attention: Yash Hosalli <hosal...@gmail.com>
Gerrit-Comment-Date: Tue, 12 May 2026 19:31:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yash Hosalli (Gerrit)

unread,
2:00 AM (7 hours ago) 2:00 AM
to dart-...@luci-project-accounts.iam.gserviceaccount.com, Samuel Rawlins, Brian Quinlan, Hangyu Jin, rev...@dartlang.org
Attention needed from Brian Quinlan and Hangyu Jin

Yash Hosalli added 1 comment

File sdk/lib/_http/websocket.dart
Line 442, Patchset 2 (Latest): /// The error is reported locally and is not transmitted to the peer.
Brian Quinlan . unresolved

What does this mean exactly? How does the error get reported? Do we have a test for this that you could point me to?

Yash Hosalli

As WebSocket itself implements both Stream and StreamSink, addError() reports the error through the Dart’s normal stream/event-sink error propagation mechanism
via _eventSink!.addError(error, stackTrace);
as found in sdk\lib\_http\websocket_impl.dart,

instead of reporting it through a separate network/protocol-level error channel.

and also any listeners attached to that same WebSocket instance via listen(onError:),can receive the error event locally.
Test files that inspected:
1) web_socket_error_test.dart
tests connection/protocol/socket failures
2) web_socket_test.dart
tests messaging, close handling, upgrades, etc.

as well as several other websocket-related tests under sdk/tests/standalone/io/, but I could not find any tests specifically covering WebSocket.addError() behaviour.

Probably as it uses Dart's internal error propagation mechanism,this behaviour is already covered by stream tests elsewhere.

Also Would you like me to update documentation to make it more precise?

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Quinlan
  • Hangyu Jin
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I8913ac4fb466e9d613b3f0c5f0727640c9d9a913
Gerrit-Change-Number: 502500
Gerrit-PatchSet: 2
Gerrit-Owner: Yash Hosalli <hosal...@gmail.com>
Gerrit-Reviewer: Brian Quinlan <bqui...@google.com>
Gerrit-Reviewer: Hangyu Jin <jinh...@google.com>
Gerrit-Reviewer: Samuel Rawlins <sraw...@google.com>
Gerrit-Attention: Brian Quinlan <bqui...@google.com>
Gerrit-Attention: Hangyu Jin <jinh...@google.com>
Gerrit-Comment-Date: Wed, 13 May 2026 06:00:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Quinlan <bqui...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages