anear-js-api 0.4.18 → 0.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,6 +37,7 @@ class AnearMessaging {
|
|
|
37
37
|
this.AnearParticipantClass = AnearParticipantClass
|
|
38
38
|
this.anearEvents = {}
|
|
39
39
|
this.eventChannels = {}
|
|
40
|
+
this.createEventsChannel = null
|
|
40
41
|
this.realtime = null
|
|
41
42
|
|
|
42
43
|
const baseUrl = this.api.api_base_url
|
|
@@ -73,8 +74,11 @@ class AnearMessaging {
|
|
|
73
74
|
this.realtime = new Ably.Realtime.Promise(clientOptions)
|
|
74
75
|
|
|
75
76
|
const connectedCallback = async () => {
|
|
76
|
-
if (this.
|
|
77
|
-
|
|
77
|
+
if (this.createEventsChannel) {
|
|
78
|
+
// if we already have setup the createEventsChannel, we are coming
|
|
79
|
+
// here by way of an Ably idle reconnect. Just return as Ably
|
|
80
|
+
// will attempt to reconnect regularly until a suspended event occurs (TBD)
|
|
81
|
+
logger.debug("Reconnecting after Messaging idle timeout...")
|
|
78
82
|
return
|
|
79
83
|
}
|
|
80
84
|
|
|
@@ -201,12 +205,12 @@ class AnearMessaging {
|
|
|
201
205
|
async setupCreateEventChannel() {
|
|
202
206
|
logger.debug(`attaching to channel ${AnearCreateEventChannelName}`)
|
|
203
207
|
|
|
204
|
-
|
|
208
|
+
this.createEventsChannel = this.getChannel(AnearCreateEventChannelName)
|
|
205
209
|
|
|
206
|
-
await this.attachChannel(createEventsChannel)
|
|
210
|
+
await this.attachChannel(this.createEventsChannel)
|
|
207
211
|
|
|
208
212
|
this.subscribeEventMessages(
|
|
209
|
-
createEventsChannel,
|
|
213
|
+
this.createEventsChannel,
|
|
210
214
|
CreateEventMessageType,
|
|
211
215
|
async message => await this.createEventMessagingCallback(message)
|
|
212
216
|
)
|