Skip to content

Commit

Permalink
Release - 4.12.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sendbird-sdk-deployment committed Jun 5, 2024
1 parent fdec35b commit 99a2478
Show file tree
Hide file tree
Showing 40 changed files with 40 additions and 36 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v4.12.7 (Jun 05, 2024)
### **Improvement**
- Fixed the Feedback feature to function correctly
- Fixed a bug where `groupChannel.cachedMetadata` was returned as `undefined` in the result value of `ChangeLogs`
## v4.12.6 (May 28, 2024)
### **Improvement**
- Fixed a bug that always throws a `Connection is canceled` error when `connect()` is failed
Expand Down
2 changes: 1 addition & 1 deletion cjs/feedChannel.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cjs/groupChannel.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cjs/index.cjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
var e=require("./__bundle-1618c4f5.cjs");class s extends e.BaseCommand{}exports.NotificationCollectionRefreshCommand=s,exports.getFeedChannelIndexBy=e=>["-lastMessageUpdatedAt","-createdAt","syncIndex"];
var e=require("./__bundle-e8b55749.cjs");class s extends e.BaseCommand{}exports.NotificationCollectionRefreshCommand=s,exports.getFeedChannelIndexBy=e=>["-lastMessageUpdatedAt","-createdAt","syncIndex"];
1 change: 0 additions & 1 deletion cjs/lib/__bundle-17e00e01.cjs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
var e=require("./__bundle-1618c4f5.cjs"),s=require("./__bundle-5388ce52.cjs");class t extends e.APIRequestCommand{constructor({channelType:s,channelUrl:t,limit:n,token:i}){super(),this.method=e.APIRequestMethod.GET,this.path=`${e.getChannelApiPathByType(s)}/${encodeURIComponent(t)}/messages/parent_thread_message`,this.params=e.deundefined(e.undefineNullProps({limit:n,token:i}))}}class n extends e.APIResponseCommand{constructor(e,t){super(e,t),this.token=t.next,this.messages=t.messages.map((t=>s.parseMessagePayload(e,t)))}}class i extends e.ChannelDataListQuery{constructor(e,s,t,n){super(e,s,t,n),this._edge=""}_validate(){return super._validate()}load(){return e.__awaiter(this,void 0,void 0,(function*(){if(this._validate()){if(this._isLoading)throw e.SendbirdError.queryInProgress;if(this._hasNext){this._isLoading=!0;const{requestQueue:s}=e.Vault.of(this._iid),i=new t({channelType:this.channelType,channelUrl:this.channelUrl,token:this._edge,limit:this.limit}),a=yield s.send(i),{messages:r,token:d}=a.as(n);return this._edge=d,this._hasNext=!!d,this._isLoading=!1,r}return[]}throw e.SendbirdError.invalidParameters}))}}exports.ThreadedParentMessageListQuery=i;
var e=require("./__bundle-e8b55749.cjs"),s=require("./__bundle-39f4c2e8.cjs");class t extends e.APIRequestCommand{constructor({channelType:s,channelUrl:t,limit:n,token:i}){super(),this.method=e.APIRequestMethod.GET,this.path=`${e.getChannelApiPathByType(s)}/${encodeURIComponent(t)}/messages/parent_thread_message`,this.params=e.deundefined(e.undefineNullProps({limit:n,token:i}))}}class n extends e.APIResponseCommand{constructor(e,t){super(e,t),this.token=t.next,this.messages=t.messages.map((t=>s.parseMessagePayload(e,t)))}}class i extends e.ChannelDataListQuery{constructor(e,s,t,n){super(e,s,t,n),this._edge=""}_validate(){return super._validate()}load(){return e.__awaiter(this,void 0,void 0,(function*(){if(this._validate()){if(this._isLoading)throw e.SendbirdError.queryInProgress;if(this._hasNext){this._isLoading=!0;const{requestQueue:s}=e.Vault.of(this._iid),i=new t({channelType:this.channelType,channelUrl:this.channelUrl,token:this._edge,limit:this.limit}),a=yield s.send(i),{messages:r,token:d}=a.as(n);return this._edge=d,this._hasNext=!!d,this._isLoading=!1,r}return[]}throw e.SendbirdError.invalidParameters}))}}exports.ThreadedParentMessageListQuery=i;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var e,s,t,n=require("./__bundle-1618c4f5.cjs"),r=require("./__bundle-5388ce52.cjs");exports.GroupChannelListOrder=void 0,(e=exports.GroupChannelListOrder||(exports.GroupChannelListOrder={})).LATEST_LAST_MESSAGE="latest_last_message",e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical",exports.PublicGroupChannelListOrder=void 0,(s=exports.PublicGroupChannelListOrder||(exports.PublicGroupChannelListOrder={})).CHRONOLOGICAL="chronological",s.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",s.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical",exports.ScheduledMessageListOrder=void 0,(t=exports.ScheduledMessageListOrder||(exports.ScheduledMessageListOrder={})).CREATED_AT="created_at",t.SCHEDULED_AT="scheduled_at";class a extends n.BaseCommand{constructor({message:e}){super(),this.message=e}}const o={};var i;exports.UserEventCategory=void 0,(i=exports.UserEventCategory||(exports.UserEventCategory={}))[i.USER_BLOCK=20001]="USER_BLOCK",i[i.USER_UNBLOCK=2e4]="USER_UNBLOCK",i[i.FRIEND_DISCOVERED=20900]="FRIEND_DISCOVERED";class d{constructor(e){this.category=e.cat,this.data=e.data}static getDataAsUserBlockEvent(e,s){const{blocker:t,blockee:r}=s.data;return{blocker:new n.User(e,t),blockee:new n.User(e,r)}}static getDataAsFriendDiscoveredEvent(e,s){const{friend_discoveries:t}=s.data;return{friendDiscoveries:Array.isArray(t)?t.map((s=>new n.User(e,s))):[]}}}class c extends n.BaseCommand{constructor(e,{userId:s}){super(),this._iid=e,this.userId=s}}class u extends n.BaseCommand{constructor(){super()}}class h extends n.WebSocketEventCommand{constructor(e,s,t){super(e,"USEV",t),this.event=new d(t)}}exports.AutoResendManager=class{constructor(e,{localCacheEnabled:s,enableAutoResend:t,dispatcher:r,sdkState:a,logger:i}){this._iid=e,o[e]=this,this._localCacheEnabled=s,this._enableAutoResend=t,this._isProcessingAutoResend=!1,this._autoResendQueue=[],this._dispatcher=r,this._logger=i,this._sdkState=a,this._localCacheEnabled&&r.on((e=>{if(e instanceof n.ConnectionStateChangeCommand)switch(e.stateType){case n.ConnectionStateType.CONNECTED:this._isProcessingAutoResend||this.processAutoResendRegisteredPendingMessages().then((()=>this._processNextAutoResend()));break;case n.ConnectionStateType.INTERNAL_DISCONNECTED:case n.ConnectionStateType.EXTERNAL_DISCONNECTED:this._isProcessingAutoResend=!1}}))}static of(e){return o[e]}processNonAutoResendRegisteredPendingMessages(){return n.__awaiter(this,void 0,void 0,(function*(){if(!this._enableAutoResend)return;const e=yield this._fetchAllCachedPendingMessages();for(const s of e)0===s.errorCode&&(this._logger.debug("cached pending message is not auto-resend registered. changing its sending status to failed: ",s.reqId),s.sendingStatus=n.SendingStatus.FAILED,s.errorCode=n.SendbirdErrorCode.ACK_TIMEOUT,this._dispatcher.dispatch(new n.MessageUpdateEventCommand({messages:[s],source:n.CollectionEventSource.LOCAL_MESSAGE_FAILED})))}))}processAutoResendRegisteredPendingMessages(){return n.__awaiter(this,void 0,void 0,(function*(){const e=yield this._fetchAllCachedPendingMessages();for(const s of e)if(this._enableAutoResend&&s.errorCode&&n.isAutoResendableError(s.errorCode)){const e=(new Date).getTime(),t=s.createdAt+2592e5;this._enableAutoResend&&e<=t?this._autoResendQueue.map((e=>e.reqId)).indexOf(s.reqId)<0&&this._autoResendQueue.push(s):(this._logger.debug("auto-resend registered pending messaged expired. expiration date: ",new Date(t).toLocaleString()),s.sendingStatus=n.SendingStatus.FAILED,this._dispatcher.dispatch(new n.MessageUpdateEventCommand({messages:[s],source:n.CollectionEventSource.LOCAL_MESSAGE_FAILED})))}}))}completeCurrentAndProcessNextAutoResend(e){if(this._localCacheEnabled&&this._enableAutoResend&&(e.sendingStatus===n.SendingStatus.SUCCEEDED||e.sendingStatus===n.SendingStatus.FAILED&&!n.isAutoResendableError(e.errorCode))){const s=this.indexOf(e);s>=0&&this._autoResendQueue.splice(s,1),0===s&&this._processNextAutoResend()}}_fetchAllCachedPendingMessages(){return n.__awaiter(this,void 0,void 0,(function*(){const e=r.UnsentMessageCache.of(this._iid),s=new r.MessageFilter;return s.replyType=n.ReplyType.ALL,yield e.fetch({sendingStatus:n.SendingStatus.PENDING,backward:!0,filter:s})}))}indexOf(e){return this._autoResendQueue.length>0?this._autoResendQueue.map((e=>e.reqId)).indexOf(e.reqId):-1}_isNotInQueue(e){return-1===this._autoResendQueue.map((e=>e.reqId)).indexOf(e.reqId)}_processNextAutoResend(){return n.__awaiter(this,void 0,void 0,(function*(){if(this._localCacheEnabled&&this._enableAutoResend&&"foreground"===this._sdkState.appState)try{if(this._autoResendQueue.length>0){this._isProcessingAutoResend||(this._logger.debug("auto-resend queue started."),this._isProcessingAutoResend=!0);const e=this._autoResendQueue[0];this._dispatcher.dispatch(new a({message:e})),this._logger.debug("processing auto-resend for message request id: ",e.reqId)}else this._logger.debug("auto-resend queue finished."),this._isProcessingAutoResend=!1}catch(e){this._logger.warn("process auto-resend error: ",e),this._isProcessingAutoResend=!1}}))}},exports.AutoResendRequestCommand=a,exports.DatabaseOpenCommand=c,exports.ReduceDBSizeEventCommand=u,exports.UserEvent=d,exports.UserEventCommand=h,exports.getGroupChannelIndexBy=e=>{switch(e){case exports.GroupChannelListOrder.LATEST_LAST_MESSAGE:return["-lastMessageUpdatedAt","-createdAt","syncIndex"];case exports.GroupChannelListOrder.CHRONOLOGICAL:return["-createdAt","syncIndex"];case exports.GroupChannelListOrder.CHANNEL_NAME_ALPHABETICAL:return["name"];default:return["-lastMessageUpdatedAt","-createdAt","syncIndex"]}};
var e,s,t,n=require("./__bundle-e8b55749.cjs"),r=require("./__bundle-39f4c2e8.cjs");exports.GroupChannelListOrder=void 0,(e=exports.GroupChannelListOrder||(exports.GroupChannelListOrder={})).LATEST_LAST_MESSAGE="latest_last_message",e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical",exports.PublicGroupChannelListOrder=void 0,(s=exports.PublicGroupChannelListOrder||(exports.PublicGroupChannelListOrder={})).CHRONOLOGICAL="chronological",s.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",s.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical",exports.ScheduledMessageListOrder=void 0,(t=exports.ScheduledMessageListOrder||(exports.ScheduledMessageListOrder={})).CREATED_AT="created_at",t.SCHEDULED_AT="scheduled_at";class a extends n.BaseCommand{constructor({message:e}){super(),this.message=e}}const o={};var i;exports.UserEventCategory=void 0,(i=exports.UserEventCategory||(exports.UserEventCategory={}))[i.USER_BLOCK=20001]="USER_BLOCK",i[i.USER_UNBLOCK=2e4]="USER_UNBLOCK",i[i.FRIEND_DISCOVERED=20900]="FRIEND_DISCOVERED";class d{constructor(e){this.category=e.cat,this.data=e.data}static getDataAsUserBlockEvent(e,s){const{blocker:t,blockee:r}=s.data;return{blocker:new n.User(e,t),blockee:new n.User(e,r)}}static getDataAsFriendDiscoveredEvent(e,s){const{friend_discoveries:t}=s.data;return{friendDiscoveries:Array.isArray(t)?t.map((s=>new n.User(e,s))):[]}}}class c extends n.BaseCommand{constructor(e,{userId:s}){super(),this._iid=e,this.userId=s}}class u extends n.BaseCommand{constructor(){super()}}class h extends n.WebSocketEventCommand{constructor(e,s,t){super(e,"USEV",t),this.event=new d(t)}}exports.AutoResendManager=class{constructor(e,{localCacheEnabled:s,enableAutoResend:t,dispatcher:r,sdkState:a,logger:i}){this._iid=e,o[e]=this,this._localCacheEnabled=s,this._enableAutoResend=t,this._isProcessingAutoResend=!1,this._autoResendQueue=[],this._dispatcher=r,this._logger=i,this._sdkState=a,this._localCacheEnabled&&r.on((e=>{if(e instanceof n.ConnectionStateChangeCommand)switch(e.stateType){case n.ConnectionStateType.CONNECTED:this._isProcessingAutoResend||this.processAutoResendRegisteredPendingMessages().then((()=>this._processNextAutoResend()));break;case n.ConnectionStateType.INTERNAL_DISCONNECTED:case n.ConnectionStateType.EXTERNAL_DISCONNECTED:this._isProcessingAutoResend=!1}}))}static of(e){return o[e]}processNonAutoResendRegisteredPendingMessages(){return n.__awaiter(this,void 0,void 0,(function*(){if(!this._enableAutoResend)return;const e=yield this._fetchAllCachedPendingMessages();for(const s of e)0===s.errorCode&&(this._logger.debug("cached pending message is not auto-resend registered. changing its sending status to failed: ",s.reqId),s.sendingStatus=n.SendingStatus.FAILED,s.errorCode=n.SendbirdErrorCode.ACK_TIMEOUT,this._dispatcher.dispatch(new n.MessageUpdateEventCommand({messages:[s],source:n.CollectionEventSource.LOCAL_MESSAGE_FAILED})))}))}processAutoResendRegisteredPendingMessages(){return n.__awaiter(this,void 0,void 0,(function*(){const e=yield this._fetchAllCachedPendingMessages();for(const s of e)if(this._enableAutoResend&&s.errorCode&&n.isAutoResendableError(s.errorCode)){const e=(new Date).getTime(),t=s.createdAt+2592e5;this._enableAutoResend&&e<=t?this._autoResendQueue.map((e=>e.reqId)).indexOf(s.reqId)<0&&this._autoResendQueue.push(s):(this._logger.debug("auto-resend registered pending messaged expired. expiration date: ",new Date(t).toLocaleString()),s.sendingStatus=n.SendingStatus.FAILED,this._dispatcher.dispatch(new n.MessageUpdateEventCommand({messages:[s],source:n.CollectionEventSource.LOCAL_MESSAGE_FAILED})))}}))}completeCurrentAndProcessNextAutoResend(e){if(this._localCacheEnabled&&this._enableAutoResend&&(e.sendingStatus===n.SendingStatus.SUCCEEDED||e.sendingStatus===n.SendingStatus.FAILED&&!n.isAutoResendableError(e.errorCode))){const s=this.indexOf(e);s>=0&&this._autoResendQueue.splice(s,1),0===s&&this._processNextAutoResend()}}_fetchAllCachedPendingMessages(){return n.__awaiter(this,void 0,void 0,(function*(){const e=r.UnsentMessageCache.of(this._iid),s=new r.MessageFilter;return s.replyType=n.ReplyType.ALL,yield e.fetch({sendingStatus:n.SendingStatus.PENDING,backward:!0,filter:s})}))}indexOf(e){return this._autoResendQueue.length>0?this._autoResendQueue.map((e=>e.reqId)).indexOf(e.reqId):-1}_isNotInQueue(e){return-1===this._autoResendQueue.map((e=>e.reqId)).indexOf(e.reqId)}_processNextAutoResend(){return n.__awaiter(this,void 0,void 0,(function*(){if(this._localCacheEnabled&&this._enableAutoResend&&"foreground"===this._sdkState.appState)try{if(this._autoResendQueue.length>0){this._isProcessingAutoResend||(this._logger.debug("auto-resend queue started."),this._isProcessingAutoResend=!0);const e=this._autoResendQueue[0];this._dispatcher.dispatch(new a({message:e})),this._logger.debug("processing auto-resend for message request id: ",e.reqId)}else this._logger.debug("auto-resend queue finished."),this._isProcessingAutoResend=!1}catch(e){this._logger.warn("process auto-resend error: ",e),this._isProcessingAutoResend=!1}}))}},exports.AutoResendRequestCommand=a,exports.DatabaseOpenCommand=c,exports.ReduceDBSizeEventCommand=u,exports.UserEvent=d,exports.UserEventCommand=h,exports.getGroupChannelIndexBy=e=>{switch(e){case exports.GroupChannelListOrder.LATEST_LAST_MESSAGE:return["-lastMessageUpdatedAt","-createdAt","syncIndex"];case exports.GroupChannelListOrder.CHRONOLOGICAL:return["-createdAt","syncIndex"];case exports.GroupChannelListOrder.CHANNEL_NAME_ALPHABETICAL:return["name"];default:return["-lastMessageUpdatedAt","-createdAt","syncIndex"]}};
1 change: 1 addition & 0 deletions cjs/lib/__bundle-39f4c2e8.cjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
var o=require("./__bundle-1618c4f5.cjs");exports.BaseChannelHandlerParams=class{constructor(){this.onUserMuted=o.noop,this.onUserUnmuted=o.noop,this.onUserBanned=o.noop,this.onUserUnbanned=o.noop,this.onChannelChanged=o.noop,this.onChannelDeleted=o.noop,this.onChannelFrozen=o.noop,this.onChannelUnfrozen=o.noop,this.onOperatorUpdated=o.noop,this.onChannelMemberCountChanged=o.noop,this.onMetaDataCreated=o.noop,this.onMetaDataUpdated=o.noop,this.onMetaDataDeleted=o.noop,this.onMetaCounterCreated=o.noop,this.onMetaCounterUpdated=o.noop,this.onMetaCounterDeleted=o.noop,this.onMessageReceived=o.noop,this.onMessageUpdated=o.noop,this.onMessageDeleted=o.noop,this.onMentionReceived=o.noop,this.onReactionUpdated=o.noop,this.onThreadInfoUpdated=o.noop}};
var o=require("./__bundle-e8b55749.cjs");exports.BaseChannelHandlerParams=class{constructor(){this.onUserMuted=o.noop,this.onUserUnmuted=o.noop,this.onUserBanned=o.noop,this.onUserUnbanned=o.noop,this.onChannelChanged=o.noop,this.onChannelDeleted=o.noop,this.onChannelFrozen=o.noop,this.onChannelUnfrozen=o.noop,this.onOperatorUpdated=o.noop,this.onChannelMemberCountChanged=o.noop,this.onMetaDataCreated=o.noop,this.onMetaDataUpdated=o.noop,this.onMetaDataDeleted=o.noop,this.onMetaCounterCreated=o.noop,this.onMetaCounterUpdated=o.noop,this.onMetaCounterDeleted=o.noop,this.onMessageReceived=o.noop,this.onMessageUpdated=o.noop,this.onMessageDeleted=o.noop,this.onMentionReceived=o.noop,this.onReactionUpdated=o.noop,this.onThreadInfoUpdated=o.noop}};
1 change: 0 additions & 1 deletion cjs/lib/__bundle-5388ce52.cjs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
var s=require("./__bundle-1618c4f5.cjs");class e extends s.User{constructor(s,e){var t;super(s,e),this.isMuted=!1,this.isMuted=null!==(t=e.is_muted)&&void 0!==t&&t}}exports.Participant=e;
var s=require("./__bundle-e8b55749.cjs");class e extends s.User{constructor(s,e){var t;super(s,e),this.isMuted=!1,this.isMuted=null!==(t=e.is_muted)&&void 0!==t&&t}}exports.Participant=e;
Loading

0 comments on commit 99a2478

Please sign in to comment.