-
Notifications
You must be signed in to change notification settings - Fork 554
improvement(driver): Differentiate clean vs. abnormal disconnects and emit abnormal disconnects to FRS #24528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement(driver): Differentiate clean vs. abnormal disconnects and emit abnormal disconnects to FRS #24528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes error emission on disconnects optional by introducing an optional error
parameter to dispose
, disconnect
, and disconnectCore
, allowing for clean disconnects when no error is provided.
- Added
error?: Error
todispose
and only pass anIAnyDriverError
todisconnect
if provided. - Changed
disconnect
anddisconnectCore
signatures to accept an optionalerr?: IAnyDriverError
. - Updated
dispose
logic to create and forward an error object only when needed.
Comments suppressed due to low confidence (2)
packages/drivers/driver-base/src/documentDeltaConnection.ts:453
- The @param annotation for disconnectCore is out of sync: it references 'reason' while the parameter is now 'err?: IAnyDriverError'. Please update the JSDoc to reflect the optional parameter name and its purpose.
* @param reason - reason for disconnect
packages/drivers/driver-base/src/documentDeltaConnection.ts:412
- Add unit tests for both clean disconnect (no error) and error-triggered disconnect to verify the optional error logic in dispose and disconnect behaves as intended.
const disconnectError = error
Today the Routerlicious service receives no signal that a Fluid client disconnected because of an error.
Changes
Client side
R11sDocumentDeltaConnection
we overridedisconnectCore
.Service side
server/routerlicious/packages/lambdas/src/nexus/index.ts
now listens for the event:AB#13598
AB#32066