Skip to content

Releases: sendbird/sendbird-chat-sdk-javascript

4.22.0

26 Mar 03:19

Choose a tag to compare

Features

Weekly Do-Not-Disturb Schedule

Added support for per-day weekly DND scheduling. You can now configure different DND time windows for each day of the week, replacing the previous single-time window DND setting.

New methods:

  • setWeeklyDoNotDisturb(weeklyDndSchedules, timezone?) — Sets a weekly DND schedule
  • getWeeklyDoNotDisturb() — Gets the current weekly DND schedule
  • clearWeeklyDoNotDisturb() — Clears the weekly DND schedule

New types:

  • DndSchedule — Model class for managing per-day DND time windows
  • DndSchedulesPartial<Record<DayOfWeek, DndTimeWindow[]>>
  • DndTimeWindow{ startHour, startMin, endHour, endMin }
  • DndSchedulePreference{ doNotDisturbOn, dndSchedules?, timezone? }
  • DayOfWeek — Enum (sunday | monday | ... | saturday)

Deprecated

  • setDoNotDisturb() — Use setWeeklyDoNotDisturb() instead.
  • getDoNotDisturb() — Use getWeeklyDoNotDisturb() instead.
  • DoNotDisturbPreference — Use DndSchedulePreference instead.

Usage Examples

Set a weekly DND schedule

import { DndSchedule, DayOfWeek } from '@sendbird/chat';

const dndSchedule = new DndSchedule();

// Set weekdays to 22:00 ~ 23:59
dndSchedule.setWeekdays([
  { startHour: 22, startMin: 0, endHour: 23, endMin: 59 },
]);

// Set weekends to full-day DND
dndSchedule.setFullDay([DayOfWeek.SATURDAY, DayOfWeek.SUNDAY]);

const preference = await sb.setWeeklyDoNotDisturb(dndSchedule, 'Asia/Seoul');

Get current weekly DND schedule

const preference = await sb.getWeeklyDoNotDisturb();

console.log(preference.doNotDisturbOn); // true
console.log(preference.timezone);       // 'Asia/Seoul'
console.log(preference.dndSchedules);
// DndSchedule {
//   monday:    [{ startHour: 22, startMin: 0, endHour: 23, endMin: 59 }],
//   tuesday:   [{ startHour: 22, startMin: 0, endHour: 23, endMin: 59 }],
//   wednesday: [{ startHour: 22, startMin: 0, endHour: 23, endMin: 59 }],
//   thursday:  [{ startHour: 22, startMin: 0, endHour: 23, endMin: 59 }],
//   friday:    [{ startHour: 22, startMin: 0, endHour: 23, endMin: 59 }],
//   saturday:  [{ startHour: 0, startMin: 0, endHour: 23, endMin: 59 }],
//   sunday:    [{ startHour: 0, startMin: 0, endHour: 23, endMin: 59 }],
// }

Clear weekly DND schedule

await sb.clearWeeklyDoNotDisturb();

Migration from deprecated DND

// Before (deprecated)
await sb.setDoNotDisturb(true, 22, 0, 8, 0, 'Asia/Seoul');

// After
const dndSchedule = new DndSchedule();
dndSchedule.setWeekdays([
  { starHour: 0, startMin: 0, endHour: 8, endMin: 0 },
  { startHour: 22, startMin: 0, endHour: 23, endMin: 59 },
]);
await sb.setWeeklyDoNotDisturb(dndSchedule, 'Asia/Seoul');

Migration Notes

Important: When you call setWeeklyDoNotDisturb, any existing DND schedule configured via the deprecated setDoNotDisturb will be reset and replaced by the new weekly schedule. The two settings are mutually exclusive — once the weekly DND schedule is set, the previous DND configuration will no longer be in effect.

Improvements

  • Added joinedAt to Member
  • Fixed a bug where MMKV data was not trimmed after deletion
  • Fixed a bug where loadMore() pagination missed channels when an empty channel exists in the channel list

4.21.4

12 Mar 02:44

Choose a tag to compare

Improvements

  • Fixed a bug Where messages received during MessageCollection.initialize() could be lost
  • Add cancelStewardTask API to AIAgentModule for canceling steward tasks by message ID

4.21.3

25 Feb 09:00

Choose a tag to compare

Improvements

  • CHANNEL_IS_FROZEN(900050) errors are no longer included in the AutoResend retry logic

4.21.2

12 Feb 05:30

Choose a tag to compare

Improvements

  • Fixed a bug where not all channels were fetched when GroupChannel ChangeLogSync failed

4.21.1

06 Feb 01:58

Choose a tag to compare

Improvements

  • Fixed an issue where event callbacks were not triggered correctly in certain environments

4.21.0

29 Jan 05:12

Choose a tag to compare

Deprecated

  • Deprecated BaseMessage.submitFeedback(), updateFeedback(), and deleteFeedback() methods
    • These methods are no longer supported and will return a SendbirdError(code: 800111) when called
  • Deprecated BaseMessage.submitMessageForm() method
    • This method is no longer supported and will return a SendbirdError(code: 800111) when called

4.20.6

20 Jan 06:17

Choose a tag to compare

Improvements

  • Fixed a bug where duplicate reconnect attempts could occur when the WebSocket closed during the RECONNECTING state
  • Made csat parameter optional in submitCSAT method
  • Added the supportMultipleTabs option to SendbirdChatParams
    • This helps ensure stable behavior in multi-tab and multi-window environments.

      This option defaults to false and is applied only when LocalCacheEnabled is set to true.
      const sb = SendbirdChat.init({
        appId: APP_ID,
        localCacheEnabled: true,
        supportMultipleTabs: true,
        ...
      });

4.20.5

24 Dec 08:19

Choose a tag to compare

Improvements

  • Fixed a payloadify error (hasBot of undefined) that occurred when loading locally cached channels.

4.20.4

12 Dec 04:54

Choose a tag to compare

Improvements

  • Added onConnectionLost in ConnectionHandler
    • The handler is called when the WebSocket connection is closed but the session persists.

4.20.3

03 Dec 04:50

Choose a tag to compare

Improvements

  • Fixed a bug where Reconnect after session refresh even it's in connecting state
  • Fixed a bug where some messages were missing due to a DB integrity issue