Releases: sendbird/sendbird-chat-sdk-javascript
Releases · sendbird/sendbird-chat-sdk-javascript
4.22.0
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 schedulegetWeeklyDoNotDisturb()— Gets the current weekly DND scheduleclearWeeklyDoNotDisturb()— Clears the weekly DND schedule
New types:
DndSchedule— Model class for managing per-day DND time windowsDndSchedules—Partial<Record<DayOfWeek, DndTimeWindow[]>>DndTimeWindow—{ startHour, startMin, endHour, endMin }DndSchedulePreference—{ doNotDisturbOn, dndSchedules?, timezone? }DayOfWeek— Enum (sunday|monday| ... |saturday)
Deprecated
setDoNotDisturb()— UsesetWeeklyDoNotDisturb()instead.getDoNotDisturb()— UsegetWeeklyDoNotDisturb()instead.DoNotDisturbPreference— UseDndSchedulePreferenceinstead.
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 deprecatedsetDoNotDisturbwill 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
joinedAttoMember - Fixed a bug where
MMKVdata 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
Improvements
- Fixed a bug Where messages received during
MessageCollection.initialize()could be lost - Add
cancelStewardTaskAPI toAIAgentModulefor canceling steward tasks by message ID
4.21.3
Improvements
CHANNEL_IS_FROZEN(900050)errors are no longer included in the AutoResend retry logic
4.21.2
Improvements
- Fixed a bug where not all channels were fetched when GroupChannel ChangeLogSync failed
4.21.1
Improvements
- Fixed an issue where event callbacks were not triggered correctly in certain environments
4.21.0
Deprecated
- Deprecated
BaseMessage.submitFeedback(),updateFeedback(), anddeleteFeedback()methods- These methods are no longer supported and will return a
SendbirdError(code: 800111)when called
- These methods are no longer supported and will return a
- Deprecated
BaseMessage.submitMessageForm()method- This method is no longer supported and will return a
SendbirdError(code: 800111)when called
- This method is no longer supported and will return a
4.20.6
Improvements
- Fixed a bug where duplicate reconnect attempts could occur when the WebSocket closed during the
RECONNECTINGstate - Made
csatparameter optional insubmitCSATmethod - Added the
supportMultipleTabsoption toSendbirdChatParams- This helps ensure stable behavior in
multi-tabandmulti-windowenvironments.
This option defaults tofalseand is applied only whenLocalCacheEnabled is set to true.
const sb = SendbirdChat.init({ appId: APP_ID, localCacheEnabled: true, supportMultipleTabs: true, ... });
- This helps ensure stable behavior in
4.20.5
Improvements
- Fixed a
payloadify error (hasBot of undefined)that occurred when loading locally cached channels.
4.20.4
Improvements
- Added
onConnectionLostinConnectionHandler- The handler is called when the WebSocket connection is closed but the session persists.
4.20.3
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