Skip to content

Commit

Permalink
Release - 4.14.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sendbird-sdk-deployment committed Oct 14, 2024
1 parent 9f14d17 commit fd57af0
Show file tree
Hide file tree
Showing 44 changed files with 51 additions and 43 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.14.5 (Oct 14, 2024)
### **Improvements**
- Added `message` property in `FileMessageCreateParams`
- Added `message` property in `FileMessage`
## v4.14.4 (Sep 27, 2024)
### **Improvements**
- Fixed a bug that local cache data is broken in a certain condition
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.

2 changes: 2 additions & 0 deletions cjs/lib/__bundle-0486c467.cjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
var s=require("./__bundle-1a495950.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-0486c467.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;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var e,s,t,n=require("./__bundle-1a495950.cjs"),r=require("./__bundle-165fd6e1.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-0486c467.cjs"),r=require("./__bundle-4bcf4070.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-0fbd5934.cjs

Large diffs are not rendered by default.

Loading

0 comments on commit fd57af0

Please sign in to comment.