Releases: sendbird/sendbird-chat-sdk-javascript
Releases · sendbird/sendbird-chat-sdk-javascript
v4.20.2
v4.20.1
Improvements
- LocalCache Improvement
v4.20.0
Improvements
- Added
onConnectionDelayedcallback toConnectionHandler
A new callback method that is invoked when the server is overloaded. This callback provides information about the delay time before automatic reconnection. After the delayed time period, the SDK automatically initiates reconnection and triggers the callback sequence:onReconnectStarted→onReconnectSucceeded
sb.addConnectionHandler('connection-handler-key', new ConnectionHandler({
onConnected: (userId: string) => {
/** A callback for when SendbirdChat is connected. */
},
onReconnectStarted: () => {
/** A callback for when SendbirdChat tries to reconnect. */
},
onReconnectSucceeded: () => {
/** A callback for when connection is reestablished. */
},
onReconnectFailed: () => {
/** A callback for when reconnection is failed. */
},
onDisconnected: () => {
/** A callback for when SendbirdChat is disconnected. */
},
onConnectionDelayed: (retryAfterTime: number /* second */) => {
/** A callback for when connection is delayed. */
// Example: Show user-friendly message
// showNotification(`Server is busy. Reconnecting in ${retryAfterTime} seconds...`);
}
}));- Added
SendbirdErrorCode.DELAYED_CONNECTINGerror code
A new error code that is thrown when the server is overloaded and connection is delayed. Provides detailed information about the delay through theerror.detailproperty.
try {
await sb.connect(USER_ID, AUTH_TOKEN);
} catch(error) {
if (error.code === SendbirdErrorCode.DELAYED_CONNECTING) {
console.log('error message', error.message);
// detail info
const detailInfo = JSON.parse(error.detail);
console.log('retryAfterTime', detailInfo.retry_after); // Delay time in seconds
console.log('reasonCode', detailInfo.reason_code); // Server reason code
console.log('message', detailInfo.message); // Detailed error message
// Handle delayed connection appropriately
// The SDK will automatically retry after the specified delay time
}
}Error Detail Properties:
-
retry_after: The delay time in seconds before automatic reconnection -
reason_code: Server-provided reason code for the delay -
message: Detailed error message explaining the delay -
Fixed typing indicator persistence bug after
channel.refresh() -
Fixed a bug where messages below the channel's
messageOffsetTimestampwere not properly filtered
v4.19.11
Improvement
- Add
copilot_conversation_onlyboolean parameter to filter copilot conversation channels - Add
copilot_support_channel_urlstring parameter for copilot support channel identification - Update
AIAgentGroupChannelListParamsinterface and default values - Update
LoadAIAgentMyGroupChannelListRequestCommandto handle new parameters
v4.19.10
Improvement
- Fixed ping interval being incorrectly converted during session refresh, causing ping frequency to change from 15 seconds to ~4 hours
v4.19.9
v4.19.8
Improvement
- Fixed a bug in parsing
dataandcustomTypeproperties inFileMessage
v4.19.7
Improvement
- Fixed a bug that prevented fetching all information stored in the memory cache for
parent messages
v4.19.6
Improvement
- Fixed a bug that
loadMore()may have unfiltered channels
v4.19.5
Improvement
- Added
createMyGroupChannelListQuery,getMyGroupChannelChangeLogsByToken,getMyGroupChannelChangeLogsByTimestampandgetUnreadMessageCountmethods to AI Agent module - Added
getContextObject,updateContextandpatchContextmethods toGroupChannel