Releases: sendbird/sendbird-chat-sdk-javascript
Releases · sendbird/sendbird-chat-sdk-javascript
4.22.5
4.22.4
Improvements
- Added early
PushTokenRegistrationState.ERRORreturn with a warning log when FCM/APNS push token register/unregister receives an empty or whitespace-only token
4.22.3
Improvements
- Fixed FileMessage / MultipleFilesMessage send requests to omit the message field when no caption is provided, instead of sending an empty string
4.22.2
Improvements
- Fixed
SendableMessage.senderbeingundefinedin rare cases where the server payload omits sender information - Added support for Node.js 24 build environment and resolved high-severity npm audit issues (devDependencies only; published bundle is unaffected)
4.22.1
Improvements
- Fix for the bug where the initial loading becomes slow when there is a large amount of channel data in the cache
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