relayx-js 1.0.11 → 1.0.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayx-js",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "main": "realtime/realtime.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -113,27 +113,18 @@ export class Realtime {
113
113
  this.#baseUrl = staging ? [
114
114
  "nats://0.0.0.0:4221",
115
115
  "nats://0.0.0.0:4222",
116
- "nats://0.0.0.0:4223",
117
- "nats://0.0.0.0:4224",
118
- "nats://0.0.0.0:4225",
119
- "nats://0.0.0.0:4226"
116
+ "nats://0.0.0.0:4223"
120
117
  ] :
121
118
  [
122
- "nats://api.relay-x.io:4221",
123
- "nats://api.relay-x.io:4222",
124
- "nats://api.relay-x.io:4223",
125
- "nats://api.relay-x.io:4224",
126
- "nats://api.relay-x.io:4225",
127
- "nats://api.relay-x.io:4226",
119
+ "tls://api.relay-x.io:4221",
120
+ "tls://api.relay-x.io:4222",
121
+ "tls://api.relay-x.io:4223"
128
122
  ];
129
123
  }else{
130
124
  this.#baseUrl = [
131
- "nats://api.relay-x.io:4221",
132
- "nats://api.relay-x.io:4222",
133
- "nats://api.relay-x.io:4223",
134
- "nats://api.relay-x.io:4224",
135
- "nats://api.relay-x.io:4225",
136
- "nats://api.relay-x.io:4226",
125
+ "tls://api.relay-x.io:4221",
126
+ "tls://api.relay-x.io:4222",
127
+ "tls://api.relay-x.io:4223"
137
128
  ];
138
129
  }
139
130
 
@@ -186,8 +177,8 @@ export class Realtime {
186
177
  this.#natsClient = await connect({
187
178
  servers: this.SEVER_URL,
188
179
  noEcho: true,
189
- maxReconnectAttempts: 1200,
190
180
  reconnect: true,
181
+ maxReconnectAttempts: 1200,
191
182
  reconnectTimeWait: 1000,
192
183
  authenticator: credsAuth,
193
184
  token: this.api_key,
@@ -217,6 +208,8 @@ export class Realtime {
217
208
 
218
209
  this.#natsClient.closed().then(() => {
219
210
  this.#log("the connection closed!");
211
+
212
+ this.#offlineMessageBuffer.length = 0;
220
213
  });
221
214
 
222
215
  (async () => {
@@ -291,6 +284,8 @@ export class Realtime {
291
284
  if(this.#natsClient !== null){
292
285
  this.reconnected = false;
293
286
  this.disconnected = true;
287
+
288
+ this.#offlineMessageBuffer.length = 0;
294
289
 
295
290
  this.#natsClient.close();
296
291
  }else{