@abihealth/goapp-react-native 1.20.2 → 1.20.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.20.3](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.20.2...goapp-react-native-v1.20.3) (2025-03-27)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * improve websocket error handling and reconnect logic ([#163](https://github.com/abiglobalhealth/react-native-sdk/issues/163)) ([d0b3ae6](https://github.com/abiglobalhealth/react-native-sdk/commit/d0b3ae606cba339550f3731d0ff89d924efbaae9))
9
+
3
10
  ## [1.20.2](https://github.com/abiglobalhealth/react-native-sdk/compare/goapp-react-native-v1.20.1...goapp-react-native-v1.20.2) (2025-03-27)
4
11
 
5
12
 
@@ -53,9 +53,6 @@ var connectWebsocket = function (_a) { return __awaiter(void 0, [_a], void 0, fu
53
53
  websocket_1.onerror = function (e) {
54
54
  console.error('🔴 WS error', JSON.stringify(e, null, 2));
55
55
  };
56
- websocket_1.onclose = function (e) {
57
- console.log('❌ WS closed', JSON.stringify(e, null, 2));
58
- };
59
56
  }
60
57
  catch (e) {
61
58
  reject(e);
@@ -124,7 +124,6 @@ var ConsultationProvider = function (_a) {
124
124
  return [4 /*yield*/, (0, websocket_1.connectWebsocket)({ token: token, userId: userId, region: region })];
125
125
  case 10:
126
126
  ws = _a.sent();
127
- console.log('🔗 Websocket connected');
128
127
  setWebsocket(ws);
129
128
  return [3 /*break*/, 12];
130
129
  case 11:
@@ -181,6 +180,11 @@ var ConsultationProvider = function (_a) {
181
180
  if (data.event === 'websocketConnected')
182
181
  console.log('🟢🟢 Websocket connected');
183
182
  };
183
+ websocket.onclose = function (e) {
184
+ console.log('❌ WS closed', JSON.stringify(e, null, 2));
185
+ console.log('🔄 Reconnecting...');
186
+ (0, websocket_1.connectWebsocket)({ token: token, userId: userId, region: region }).then(setWebsocket).catch(handleError);
187
+ };
184
188
  }, [websocket]);
185
189
  var value = {
186
190
  token: token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abihealth/goapp-react-native",
3
- "version": "1.20.2",
3
+ "version": "1.20.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"