Skip to content

Releases: sendbird/sendbird-chat-sdk-javascript

v4.20.0

25 Sep 03:51
Compare
Choose a tag to compare

Improvements

  • Added onConnectionDelayed callback to ConnectionHandler
    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: onReconnectStartedonReconnectSucceeded
  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_CONNECTING error code
    A new error code that is thrown when the server is overloaded and connection is delayed. Provides detailed information about the delay through the error.detail property.
  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 messageOffsetTimestamp were not properly filtered

v4.19.11

22 Sep 02:49
Compare
Choose a tag to compare

Improvement

  • Add copilot_conversation_only boolean parameter to filter copilot conversation channels
  • Add copilot_support_channel_url string parameter for copilot support channel identification
  • Update AIAgentGroupChannelListParams interface and default values
  • Update LoadAIAgentMyGroupChannelListRequestCommand to handle new parameters

v4.19.10

19 Sep 01:59
Compare
Choose a tag to compare

Improvement

  • Fixed ping interval being incorrectly converted during session refresh, causing ping frequency to change from 15 seconds to ~4 hours

v4.19.9

12 Sep 07:22
Compare
Choose a tag to compare

Improvement

  • Improved stability

v4.19.8

27 Aug 06:26
Compare
Choose a tag to compare

Improvement

  • Fixed a bug in parsing data and customType properties in FileMessage

v4.19.7

22 Aug 02:31
Compare
Choose a tag to compare

Improvement

  • Fixed a bug that prevented fetching all information stored in the memory cache for parent messages

v4.19.6

31 Jul 01:23
Compare
Choose a tag to compare

Improvement

  • Fixed a bug that loadMore() may have unfiltered channels

v4.19.5

22 Jul 05:49
Compare
Choose a tag to compare

Improvement

  • Added createMyGroupChannelListQuery, getMyGroupChannelChangeLogsByToken, getMyGroupChannelChangeLogsByTimestamp and getUnreadMessageCount methods to AI Agent module
  • Added getContextObject, updateContext and patchContext methods to GroupChannel

v4.19.4

09 Jul 01:53
Compare
Choose a tag to compare

Improvement

  • Added summary field to Conversation class

v4.19.3

03 Jul 03:35
Compare
Choose a tag to compare

Improvement

  • Fixed a bug where sb.connect() would not correctly throw the error received from the server