@wavemaker/rn-codegen 11.9.1-next.27509 → 11.9.1-next.27512

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.
rn-codegen/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/rn-codegen",
3
- "version": "11.9.1-next.27509",
3
+ "version": "11.9.1-next.27512",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9,9 +9,9 @@
9
9
  "postinstall": "echo \"\""
10
10
  },
11
11
  "dependencies": {
12
- "@wavemaker/app-rn-runtime": "11.9.1-next.27509",
13
- "@wavemaker/variables": "11.9.1-next.27509",
14
- "@wavemaker/rn-codegen": "11.9.1-next.27509",
12
+ "@wavemaker/app-rn-runtime": "11.9.1-next.27512",
13
+ "@wavemaker/variables": "11.9.1-next.27512",
14
+ "@wavemaker/rn-codegen": "11.9.1-next.27512",
15
15
  "@wavemaker/wavepulse-agent": "1.0.9",
16
16
  "deprecated-react-native-prop-types": "4.1.0",
17
17
  "expo": "50.0.17",
@@ -9,9 +9,9 @@
9
9
  "postinstall": "node ./scripts/post-build.js"
10
10
  },
11
11
  "dependencies": {
12
- "@wavemaker/app-rn-runtime": "11.9.1-next.27509",
13
- "@wavemaker/variables": "11.9.1-next.27509",
14
- "@wavemaker/rn-codegen": "11.9.1-next.27509",
12
+ "@wavemaker/app-rn-runtime": "11.9.1-next.27512",
13
+ "@wavemaker/variables": "11.9.1-next.27512",
14
+ "@wavemaker/rn-codegen": "11.9.1-next.27512",
15
15
  "@wavemaker/wavepulse-agent": "1.0.9",
16
16
  "deprecated-react-native-prop-types": "4.1.0",
17
17
  "expo": "50.0.17",
@@ -1,11 +1,18 @@
1
1
  "use strict";
2
2
  import { Agent, WebSocketChannel, EVENTS, CALLS} from '@wavemaker/wavepulse-agent/index';
3
3
  import axios from 'axios';
4
-
4
+ const MAX_WAITING_TIME_FOR_CONNECTION = 30 * 1000;
5
5
  let wavePulseAgent = new (class WavePulseAgent extends Agent {
6
6
  constructor() {
7
7
  super(...arguments);
8
8
  this.isConnected = false;
9
+ this.closed = false;
10
+ setTimeout(() => {
11
+ if (!this.isConnected) {
12
+ this.closed = true;
13
+ this.buffer = [];
14
+ }
15
+ }, MAX_WAITING_TIME_FOR_CONNECTION);
9
16
  }
10
17
  isFlushAllowed() {
11
18
  return this.isConnected;
@@ -20,6 +27,11 @@ let wavePulseAgent = new (class WavePulseAgent extends Agent {
20
27
  'channelId': channelId
21
28
  }));
22
29
  }
30
+ notify(event, type, args, buffer) {
31
+ if (!this.closed) {
32
+ super.notify(event, type, args, buffer);
33
+ }
34
+ }
23
35
  })();
24
36
  let currentPage = null;
25
37
  let currentWidgets = {};
@@ -215,6 +227,7 @@ function bindCalls() {
215
227
  wavePulseAgent.onInvoke(CALLS.HANDSHAKE.WISH, (args) => {
216
228
  setTimeout(() => {
217
229
  wavePulseAgent.isConnected = true;
230
+ wavePulseAgent.isClosed = false;
218
231
  wavePulseAgent.processBuffer();
219
232
  }, 2000);
220
233
  return Promise.resolve('Hello');