Repository navigation
fix: report error code 80017 for a closed connection - #1252
RaphaelFakhri wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe closed connection reason now uses the message "Connection closed", status 400, and error code 80017. A test checks those values in the closed state and when attaching a channel. ChangesClosed Connection Error
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change aligns the reported closed-connection error with the intended code and status. It is ready to merge after normal checks. Pre-merge checks |
|
Fixes #797
Description
When the connection is
closingorclosed, the SDK reportsErrorInfo("Can't attach when not in an active state", 200, 10000). Error code10000means "no error" in the Ably error list, and the HTTP status code is200. This error appears in two places:reasonof theclosingandclosedconnection state changes, and of thedetachedchannel state change that follows a close.attach()on a channel after the connection closes.This change reports
ErrorInfo("Connection closed", 400, 80017)instead. Code80017is the "connection closed" code in the Ably error list, and ably-js reports the same code and status code for theclosingandclosedstates.Testing
ConnectionManagerClosedErrorTestconnects through a mock transport that refuses connections, closes the connection, and assertscode80017 andstatusCode400 on theclosedstate change and on a laterattach(). It fails without the change (Expected: is <80017> but: was <10000>) and passes with it.Run it with:
Summary by CodeRabbit