@roeehrl/tinode-sdk 0.25.1-sqlite.4 → 0.25.1-sqlite.5
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 +1 -1
- package/src/connection.js +10 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roeehrl/tinode-sdk",
|
|
3
3
|
"description": "Tinode SDK fork with Storage interface for SQLite persistence in React Native",
|
|
4
|
-
"version": "0.25.1-sqlite.
|
|
4
|
+
"version": "0.25.1-sqlite.5",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"format": "js-beautify -r src/*.js",
|
package/src/connection.js
CHANGED
|
@@ -354,7 +354,11 @@ export default class Connection {
|
|
|
354
354
|
|
|
355
355
|
this.reconnect = force => {
|
|
356
356
|
this.#boffStop();
|
|
357
|
-
|
|
357
|
+
// Catch the promise to prevent unhandled rejection
|
|
358
|
+
// Errors are handled via onDisconnect callback instead
|
|
359
|
+
this.connect(null, force).catch(_ => {
|
|
360
|
+
Connection.#log('LP reconnect promise rejected, error handled via onDisconnect callback');
|
|
361
|
+
});
|
|
358
362
|
};
|
|
359
363
|
|
|
360
364
|
this.disconnect = _ => {
|
|
@@ -463,7 +467,11 @@ export default class Connection {
|
|
|
463
467
|
|
|
464
468
|
this.reconnect = force => {
|
|
465
469
|
this.#boffStop();
|
|
466
|
-
|
|
470
|
+
// Catch the promise to prevent unhandled rejection
|
|
471
|
+
// Errors are handled via onDisconnect callback instead
|
|
472
|
+
this.connect(null, force).catch(_ => {
|
|
473
|
+
Connection.#log('WS reconnect promise rejected, error handled via onDisconnect callback');
|
|
474
|
+
});
|
|
467
475
|
};
|
|
468
476
|
|
|
469
477
|
this.disconnect = _ => {
|