From 0a643c9b2c7c717943a359008f10334cbe47257e Mon Sep 17 00:00:00 2001 From: ivelin Date: Thu, 7 Oct 2021 14:16:05 +0000 Subject: [PATCH 01/47] chore: linting Signed-off-by: ivelin --- tests/unit/remote/edgeAPI.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/remote/edgeAPI.spec.js b/tests/unit/remote/edgeAPI.spec.js index a11b9e35..5456f6af 100644 --- a/tests/unit/remote/edgeAPI.spec.js +++ b/tests/unit/remote/edgeAPI.spec.js @@ -114,9 +114,9 @@ describe('PeerRoom class coverage - p2p communication layer', () => { } }) expect(pnp.state.peerFetch.request).toHaveReturnedWith( - { + { header: { status: 200 }, - content: '{event: "object_detection"}' + content: '{event: "object_detection"}' } ) expect(response).toEqual('{event: "object_detection"}') From 6ee6adaecbf82783f9e0eb17bd33308b4fc58de5 Mon Sep 17 00:00:00 2001 From: ivelin Date: Thu, 7 Oct 2021 17:54:22 +0000 Subject: [PATCH 02/47] fix: pwa error - no icon with purpose anyFailure reason Manifest does not contain a suitable icon - PNG, SVG or WebP format of at least 144 px is required, the sizes attribute must be set, and the purpose attribute, if set, must include any. No supplied icon is at least 144 px square in PNG, SVG or WebP format, with the purpose attribute unset or set to any Signed-off-by: ivelin --- .gitpod.yml | 2 +- package-lock.json | 2 +- public/manifest.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 8d5faa26..7fc6f4d3 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -9,7 +9,7 @@ tasks: npm update npm audit fix npm install -g @vue/cli - command: | + - command: | echo "Starting Ambianic UI in dev mode:" npm run serve - command: | diff --git a/package-lock.json b/package-lock.json index a5bfecc7..4c6dfc66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ambianic-ui", - "version": "2.19.2", + "version": "2.19.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/public/manifest.json b/public/manifest.json index deae923b..6bddfffd 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -12,7 +12,7 @@ "src": "/img/icons/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png", - "purpose": "maskable" + "purpose": "any" } ], "start_url": "/index.html", From 1e4c1450b50df548cf0d6d72721447dffa5a28cb Mon Sep 17 00:00:00 2001 From: ivelin Date: Thu, 7 Oct 2021 21:59:36 +0000 Subject: [PATCH 03/47] chore: cleanup files Signed-off-by: ivelin --- package-lock.json | 24 +- test.log | 3044 --------------------------------------------- 2 files changed, 12 insertions(+), 3056 deletions(-) delete mode 100644 test.log diff --git a/package-lock.json b/package-lock.json index 4c6dfc66..4c037b89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6557,9 +6557,9 @@ "dev": true }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -21317,9 +21317,9 @@ } }, "nth-check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", - "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz", + "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==", "dev": true, "requires": { "boolbase": "^1.0.0" @@ -24680,9 +24680,9 @@ } }, "semver-regex": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz", - "integrity": "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", + "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", "dev": true }, "send": { @@ -26533,9 +26533,9 @@ } }, "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, "to-arraybuffer": { diff --git a/test.log b/test.log deleted file mode 100644 index b01e0d5d..00000000 --- a/test.log +++ /dev/null @@ -1,3044 +0,0 @@ - -> ambianic-ui@2.14.1 test:unit /workspace/ambianic-ui -> jest "tests/unit/store/" - -FAIL tests/unit/store/pnp-mutations.spec.js - ● Console - - console.debug - NEW_REMOTE_PEER_ID: Setting state.remotePeerId to : a_new_remote_peer_id - - at Store.debug (src/store/pnp.js:135:13) - at Array.forEach () - - console.debug - REMOTE_PEER_ID_REMOVED: Removing remote Peer Id from local storage - - at Store.debug (src/store/pnp.js:140:13) - at Array.forEach () - - console.debug - PEER_FETCH: Setting PeerFetch instance. - - at Store.debug (src/store/pnp.js:145:13) - at Array.forEach () - - console.debug - store.getters { isEdgeConnected: [Getter] } - - at Object.debug (tests/unit/store/pnp-mutations.spec.js:156:13) - - ● PnP state machine mutations - p2p communication layer › NEW_REMOTE_PEER_ID - - expect(received).toBe(expected) // Object.is equality - - Expected: "a new remote peer id" - Received: "a_new_remote_peer_id" - - 135 | test('NEW_REMOTE_PEER_ID', () => { - 136 | store.commit(NEW_REMOTE_PEER_ID, 'a_new_remote_peer_id') - > 137 | expect(store.state.pnp.remotePeerId).toBe('a new remote peer id') - | ^ - 138 | expect(window.localStorage.setItem).toHaveBeenCalledTimes(1) - 139 | expect(window.localStorage.setItem).toHaveBeenCalledWith(`${STORAGE_KEY}.remotePeerId`, 'a_new_remote_peer_id') - 140 | }) - - at Object.toBe (tests/unit/store/pnp-mutations.spec.js:137:42) - -PASS tests/unit/store/pnp-actions.spec.js - ● Console - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.log - BUG WORKAROUND: Peer lost ID. Resetting to last known ID. - - at Store.log (src/store/pnp.js:358:15) - - console.log - ######## >>>>> peerConnectionStatus = PEER_CONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - PNP Service disconnected. Reconnecting... - - at log (src/store/pnp.js:383:17) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.log - PNP Service still not connected. Will retry shortly. - - at log (src/store/pnp.js:393:19) - - console.debug - jest running pending timers - - at Object.debug (tests/unit/store/pnp-actions.spec.js:199:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - at Array.forEach () - - console.log - Remote peer Id found a_known_remote_peer_id - - at log (src/store/pnp.js:400:17) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_known_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.debug - i { - _createServerConnection: [Getter/Setter], - _initialize: [Getter/Setter], - _handleMessage: [Getter/Setter], - _storeMessage: [Getter/Setter], - _getMessages: [Getter/Setter], - connect: [Getter/Setter], - call: [Getter/Setter], - _addConnection: [Getter/Setter], - _removeConnection: [Getter/Setter], - getConnection: [Getter/Setter], - _delayedAbort: [Getter/Setter], - _abort: [Getter/Setter], - emitError: [Getter/Setter], - destroy: [Getter/Setter], - _cleanup: [Getter/Setter], - _cleanupPeer: [Getter/Setter], - disconnect: [Getter/Setter], - reconnect: [Getter/Setter], - listAllPeers: [Getter/Setter], - eventNames: [Getter/Setter], - listeners: [Getter/Setter], - listenerCount: [Getter/Setter], - emit: [Getter/Setter], - on: [Getter/Setter], - once: [Getter/Setter], - removeListener: [Getter/Setter], - removeAllListeners: [Getter/Setter], - id: 'my_local_peer_id' - } - - at debug (src/store/pnp.js:164:13) - - console.debug - Fetching room members PeerRoom { - _buildUrl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - _protoImpl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - }, - _restCall: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function: AsyncFunction] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - }, - _protoImpl: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _getRoomId: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _joinRoom: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - getRoomMembers: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - join: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - } - } - - at debug (src/store/pnp.js:166:13) - - console.debug - mock roomMembers { clientsIds: [ 'my_local_peer_id', 'a_remote_peer_id' ] } - - at PeerRoom.debug (tests/unit/store/pnp-actions.spec.js:216:17) - - console.debug - Fetched roomMembers { clientsIds: [ 'my_local_peer_id', 'a_remote_peer_id' ] } - - at debug (src/store/pnp.js:168:13) - - console.debug - myRoom members [ 'my_local_peer_id', 'a_remote_peer_id' ] - - at debug (src/store/pnp.js:170:13) - - console.debug - remotePeerId: a_remote_peer_id found among myRoom members: my_local_peer_id,a_remote_peer_id - - at debug (src/store/pnp.js:175:13) - - console.log - Remote peer Id found a_remote_peer_id - - at log (src/store/pnp.js:400:17) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.debug - i { - _createServerConnection: [Getter/Setter], - _initialize: [Getter/Setter], - _handleMessage: [Getter/Setter], - _storeMessage: [Getter/Setter], - _getMessages: [Getter/Setter], - connect: [Getter/Setter], - call: [Getter/Setter], - _addConnection: [Getter/Setter], - _removeConnection: [Getter/Setter], - getConnection: [Getter/Setter], - _delayedAbort: [Getter/Setter], - _abort: [Getter/Setter], - emitError: [Getter/Setter], - destroy: [Getter/Setter], - _cleanup: [Getter/Setter], - _cleanupPeer: [Getter/Setter], - disconnect: [Getter/Setter], - reconnect: [Getter/Setter], - listAllPeers: [Getter/Setter], - eventNames: [Getter/Setter], - listeners: [Getter/Setter], - listenerCount: [Getter/Setter], - emit: [Getter/Setter], - on: [Getter/Setter], - once: [Getter/Setter], - removeListener: [Getter/Setter], - removeAllListeners: [Getter/Setter], - id: 'my_local_peer_id' - } - - at debug (src/store/pnp.js:164:13) - - console.debug - Fetching room members PeerRoom { - _buildUrl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - _protoImpl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - }, - _restCall: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function: AsyncFunction] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - }, - _protoImpl: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _getRoomId: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _joinRoom: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - getRoomMembers: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - join: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - } - } - - at debug (src/store/pnp.js:166:13) - - console.debug - mock roomMembers { clientsIds: [ 'my_local_peer_id', 'a_problematic_remote_peer_id' ] } - - at PeerRoom.debug (tests/unit/store/pnp-actions.spec.js:247:17) - - console.debug - Fetched roomMembers { clientsIds: [ 'my_local_peer_id', 'a_problematic_remote_peer_id' ] } - - at debug (src/store/pnp.js:168:13) - - console.debug - myRoom members [ 'my_local_peer_id', 'a_problematic_remote_peer_id' ] - - at debug (src/store/pnp.js:170:13) - - console.debug - remotePeerId: undefined found among myRoom members: my_local_peer_id,a_problematic_remote_peer_id - - at debug (src/store/pnp.js:175:13) - - console.log - recycling problematic peers Set(1) { 'a_problematic_remote_peer_id' } - - at log (src/store/pnp.js:179:15) - - console.log - Remote peer Id found a_problematic_remote_peer_id - - at log (src/store/pnp.js:400:17) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_problematic_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.debug - i { - _createServerConnection: [Getter/Setter], - _initialize: [Getter/Setter], - _handleMessage: [Getter/Setter], - _storeMessage: [Getter/Setter], - _getMessages: [Getter/Setter], - connect: [Getter/Setter], - call: [Getter/Setter], - _addConnection: [Getter/Setter], - _removeConnection: [Getter/Setter], - getConnection: [Getter/Setter], - _delayedAbort: [Getter/Setter], - _abort: [Getter/Setter], - emitError: [Getter/Setter], - destroy: [Getter/Setter], - _cleanup: [Getter/Setter], - _cleanupPeer: [Getter/Setter], - disconnect: [Getter/Setter], - reconnect: [Getter/Setter], - listAllPeers: [Getter/Setter], - eventNames: [Getter/Setter], - listeners: [Getter/Setter], - listenerCount: [Getter/Setter], - emit: [Getter/Setter], - on: [Getter/Setter], - once: [Getter/Setter], - removeListener: [Getter/Setter], - removeAllListeners: [Getter/Setter], - id: 'my_local_peer_id' - } - - at debug (src/store/pnp.js:164:13) - - console.debug - Fetching room members PeerRoom { - _buildUrl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - _protoImpl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - }, - _restCall: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function: AsyncFunction] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - }, - _protoImpl: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _getRoomId: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _joinRoom: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - getRoomMembers: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - join: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - } - } - - at debug (src/store/pnp.js:166:13) - - console.debug - mock roomMembers { clientsIds: [ 'my_local_peer_id' ] } - - at PeerRoom.debug (tests/unit/store/pnp-actions.spec.js:275:17) - - console.debug - Fetched roomMembers { clientsIds: [ 'my_local_peer_id' ] } - - at debug (src/store/pnp.js:168:13) - - console.debug - myRoom members [ 'my_local_peer_id' ] - - at debug (src/store/pnp.js:170:13) - - console.debug - remotePeerId: undefined found among myRoom members: my_local_peer_id - - at debug (src/store/pnp.js:175:13) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.debug - i { - _createServerConnection: [Getter/Setter], - _initialize: [Getter/Setter], - _handleMessage: [Getter/Setter], - _storeMessage: [Getter/Setter], - _getMessages: [Getter/Setter], - connect: [Getter/Setter], - call: [Getter/Setter], - _addConnection: [Getter/Setter], - _removeConnection: [Getter/Setter], - getConnection: [Getter/Setter], - _delayedAbort: [Getter/Setter], - _abort: [Getter/Setter], - emitError: [Getter/Setter], - destroy: [Getter/Setter], - _cleanup: [Getter/Setter], - _cleanupPeer: [Getter/Setter], - disconnect: [Getter/Setter], - reconnect: [Getter/Setter], - listAllPeers: [Getter/Setter], - eventNames: [Getter/Setter], - listeners: [Getter/Setter], - listenerCount: [Getter/Setter], - emit: [Getter/Setter], - on: [Getter/Setter], - once: [Getter/Setter], - removeListener: [Getter/Setter], - removeAllListeners: [Getter/Setter], - id: 'my_local_peer_id' - } - - at debug (src/store/pnp.js:164:13) - - console.debug - Fetching room members PeerRoom { - _buildUrl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - _protoImpl: [Function: $buildUrl] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - }, - _restCall: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function: AsyncFunction] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - }, - _protoImpl: [Function: $restCall] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _getRoomId: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $getRoomId] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - _joinRoom: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: $joinRoom] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - getRoomMembers: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: getRoomMembers] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - }, - join: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: undefined, - _protoImpl: [Function: join] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - constructor: [Function] - } - } - } - - at debug (src/store/pnp.js:166:13) - - console.log - Error while looking for remote peer. Will retry shortly. Error: Problem occured during peer discovery. - at PeerRoom. (/workspace/ambianic-ui/tests/unit/store/pnp-actions.spec.js:299:15) - at /workspace/ambianic-ui/node_modules/jest-mock/build/index.js:480:41 - at PeerRoom. (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:489:13) - at PeerRoom.mockConstructor (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:182:19) - at PeerRoom.getRoomMembers (eval at _createMockFunction (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:674:31), :3:58) - at /workspace/ambianic-ui/node_modules/jest-mock/build/index.js:485:35 - at PeerRoom. (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:489:13) - at PeerRoom.mockConstructor (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:182:19) - at PeerRoom.getRoomMembers (eval at _createMockFunction (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:674:31), :3:58) - at getRoomMembers (/workspace/ambianic-ui/src/store/pnp.js:167:38) - at discoverRemotePeerId (/workspace/ambianic-ui/src/store/pnp.js:389:32) - at Store.discoveryLoopId (/workspace/ambianic-ui/src/store/pnp.js:408:11) - at Array.wrappedActionHandler (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:849:23) - at Store.dispatch (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:514:15) - at Store.boundDispatch [as dispatch] (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:404:21) - at Object.dispatch (/workspace/ambianic-ui/tests/unit/store/pnp-actions.spec.js:302:17) - at Object.asyncJestTest (/workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) - at /workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:45:12 - at new Promise () - at mapper (/workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:28:19) - at /workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:75:41 - at processTicksAndRejections (node:internal/process/task_queues:94:5) - - at log (src/store/pnp.js:396:17) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_known_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>>> Closing and cleaning up existing peer connection. - - at Store.info (src/store/pnp.js:434:15) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.debug - jest running pending timers - - at Object.debug (tests/unit/store/pnp-actions.spec.js:349:13) - - console.debug - Problematic remote peer ID: a_known_remote_peer_id - - at debug (src/store/pnp.js:449:17) - at Array.forEach () - - console.warn - Error destroying peer. - - 450 | peer.destroy() - 451 | } catch (err) { - > 452 | console.warn('Error destroying peer.') - | ^ - 453 | } finally { - 454 | console.info('It took too long to setup a connection. Resetting peer.') - 455 | dispatch(INITIALIZE_PNP) - - at warn (src/store/pnp.js:452:17) - at node_modules/@jest/fake-timers/build/jestFakeTimers.js:524:25 - at callback (node_modules/@jest/fake-timers/build/jestFakeTimers.js:516:29) - at FakeTimers._runTimerHandle (node_modules/@jest/fake-timers/build/jestFakeTimers.js:560:9) - at node_modules/@jest/fake-timers/build/jestFakeTimers.js:228:40 - at Array.forEach () - at FakeTimers.runOnlyPendingTimers (node_modules/@jest/fake-timers/build/jestFakeTimers.js:228:8) - - console.info - It took too long to setup a connection. Resetting peer. - - at info (src/store/pnp.js:454:17) - at Array.forEach () - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId some_saved_ID - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - Peer constructor calls [ - [], - [ - 'some_saved_ID', - { - host: 'ambianic-pnp.herokuapp.com', - port: 443, - secure: true, - debug: 3 - } - ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:355:13) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_known_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>>> Closing and cleaning up existing peer connection. - - at Store.info (src/store/pnp.js:434:15) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.debug - jest running pending timers - - at Object.debug (tests/unit/store/pnp-actions.spec.js:392:13) - - console.debug - Problematic remote peer ID: a_known_remote_peer_id - - at debug (src/store/pnp.js:449:17) - at Array.forEach () - - console.info - It took too long to setup a connection. Resetting peer. - - at info (src/store/pnp.js:454:17) - at Array.forEach () - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId some_saved_ID - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - Peer constructor calls [ - [], - [ - 'some_saved_ID', - { - host: 'ambianic-pnp.herokuapp.com', - port: 443, - secure: true, - debug: 3 - } - ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:398:13) - - console.log - PNP Service disconnected. Reconnecting... - - at Store.log (src/store/pnp.js:420:15) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTING - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_known_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - peer.on.mock.calls [ - [ 'open', [Function (anonymous)] ], - [ 'disconnected', [Function (anonymous)] ], - [ 'close', [Function (anonymous)] ], - [ 'error', [Function (anonymous)] ], - [ 'connection', [Function (anonymous)] ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:480:13) - - console.debug - onErrorCallback [ 'error', [Function (anonymous)] ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:482:13) - - console.log - PnP service connection error a_network_error - - at Array.log (src/store/pnp.js:238:13) - - console.log - pnp service connection error { err: 'a_network_error' } - - at Array.log (src/store/pnp.js:245:13) - - console.log - Will try to reconnect to PnP server... - - at Array.log (src/store/pnp.js:246:13) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - peer.on.mock.calls [ - [ 'open', [Function (anonymous)] ], - [ 'disconnected', [Function (anonymous)] ], - [ 'close', [Function (anonymous)] ], - [ 'error', [Function (anonymous)] ], - [ 'connection', [Function (anonymous)] ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:497:13) - - console.debug - onConnectionCallback [ 'connection', [Function (anonymous)] ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:499:13) - - console.debug - #####>>>>> remote peer trying to establish connection - - at Array.debug (src/store/pnp.js:254:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - onCloseCallback [ 'close', [Function (anonymous)] ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:524:13) - - console.log - Connection to PnP server destroyed - - at Array.log (src/store/pnp.js:229:13) - - console.log - Reconnecting to PnP server... - - at Array.log (src/store/pnp.js:230:13) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.log - pnp client: Connection lost. Please reconnect. - - at Array.log (src/store/pnp.js:224:13) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.log - pnp client: Received null id from peer open - - at Array.log (src/store/pnp.js:204:15) - - console.log - pnp client: myPeerId: a_saved_peer_id_567 - - at Array.log (src/store/pnp.js:216:13) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - Remote peer Id found a_known_remote_peer_id - - at log (src/store/pnp.js:400:17) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_known_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - mutation.type PNP_SERVICE_CONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:585:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:586:15) - at Array.forEach () - - console.log - pnp client: Service returned new peerId. Old, New a_saved_peer_id_567 a_known_peer_id_123 - - at Array.log (src/store/pnp.js:208:17) - - console.debug - mutation.type NEW_PEER_ID - - at debug (tests/unit/store/pnp-actions.spec.js:585:15) - at Array.forEach () - - console.debug - mutation.payload a_known_peer_id_123 - - at debug (tests/unit/store/pnp-actions.spec.js:586:15) - at Array.forEach () - - console.log - pnp client: myPeerId: a_known_peer_id_123 - - at Array.log (src/store/pnp.js:216:13) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.debug - mutation.type PEER_DISCOVERING - - at debug (tests/unit/store/pnp-actions.spec.js:585:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:586:15) - at Array.forEach () - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - Remote peer Id found a_known_remote_peer_id - - at log (src/store/pnp.js:400:17) - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTED - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_known_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - peer.on.mock.calls [ - [ 'open', [Function (anonymous)] ], - [ 'disconnected', [Function (anonymous)] ], - [ 'close', [Function (anonymous)] ], - [ 'error', [Function (anonymous)] ], - [ 'connection', [Function (anonymous)] ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:601:13) - - console.debug - #####>>>>> remote peer trying to establish connection - - at Array.debug (src/store/pnp.js:254:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.debug - Peer DataConnection is now open. Creating PeerFetch wrapper. - - at Array.debug (src/store/pnp.js:271:13) - - console.debug - PEER_FETCH: Setting PeerFetch instance. - - at Store.debug (src/store/pnp.js:145:13) - at Array.forEach () - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - peer.on.mock.calls [ - [ 'open', [Function (anonymous)] ], - [ 'disconnected', [Function (anonymous)] ], - [ 'close', [Function (anonymous)] ], - [ 'error', [Function (anonymous)] ], - [ 'connection', [Function (anonymous)] ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:626:13) - - console.debug - #####>>>>> remote peer trying to establish connection - - at Array.debug (src/store/pnp.js:254:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.debug - #########>>>>>>>>> p2p connection closed - - at Array.debug (src/store/pnp.js:285:13) - - console.debug - Will try to open a new peer connection shortly. - - at Array.debug (src/store/pnp.js:286:13) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - PNP Service disconnected. Reconnecting... - - at log (src/store/pnp.js:383:17) - - console.log - PNP Service still not connected. Will retry shortly. - - at log (src/store/pnp.js:393:19) - - console.log - pnp client: creating peer - - at Store.log (src/store/pnp.js:324:13) - - console.log - pnp client: last saved myPeerId undefined - - at Store.log (src/store/pnp.js:328:13) - - console.log - pnp client: peer created - - at Store.log (src/store/pnp.js:338:13) - - console.debug - peer.on.mock.calls [ - [ 'open', [Function (anonymous)] ], - [ 'disconnected', [Function (anonymous)] ], - [ 'close', [Function (anonymous)] ], - [ 'error', [Function (anonymous)] ], - [ 'connection', [Function (anonymous)] ] - ] - - at Object.debug (tests/unit/store/pnp-actions.spec.js:651:13) - - console.debug - #####>>>>> remote peer trying to establish connection - - at Array.debug (src/store/pnp.js:254:13) - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.info - Error in connection to remote peer ID a_remote_peer_id undefined - - at Array.info (src/store/pnp.js:296:13) - - console.info - ######>>>>>>> p2p connection error undefined - - at Store.info (src/store/pnp.js:552:13) - - console.info - Problematic remote peer ID: a_remote_peer_id - - at Store.info (src/store/pnp.js:553:13) - - console.info - Will try a new connection shortly. - - at Store.info (src/store/pnp.js:556:13) - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - PNP Service disconnected. Reconnecting... - - at log (src/store/pnp.js:383:17) - - console.log - PNP Service still not connected. Will retry shortly. - - at log (src/store/pnp.js:393:19) - - console.debug - mutation.type PEER_AUTHENTICATING - - at debug (tests/unit/store/pnp-actions.spec.js:712:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:713:15) - at Array.forEach () - - console.debug - mutation.type USER_MESSAGE - - at debug (tests/unit/store/pnp-actions.spec.js:712:15) - at Array.forEach () - - console.debug - mutation.payload Authenticating remote peer: a_remote_peer_id - - at debug (tests/unit/store/pnp-actions.spec.js:713:15) - at Array.forEach () - - console.log - Authenticating remote Peer ID: a_remote_peer_id - - at Store.log (src/store/pnp.js:473:13) - - console.debug - mock get { url: 'http://localhost:8778' } - - at PeerFetch.debug (tests/unit/store/pnp-actions.spec.js:688:17) - - console.log - PEER_AUTHENTICATE { - request: { url: 'http://localhost:8778' }, - response: [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - header: [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - status: 200 - } - } - } - - at Store.log (src/store/pnp.js:480:15) - - console.log - PEER_AUTHENTICATE status OK - - at Store.log (src/store/pnp.js:482:17) - - console.debug - mock textDecode undefined - - at PeerFetch.debug (tests/unit/store/pnp-actions.spec.js:698:17) - - console.log - PEER_AUTHENTICATE response body OK = true - - at Store.log (src/store/pnp.js:487:17) - - console.debug - mutation.type PEER_CONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:712:15) - at Array.forEach () - - console.debug - mutation.payload [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - dataChannel: [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - }, - peer: 'a_remote_peer_id' - } - - at debug (tests/unit/store/pnp-actions.spec.js:713:15) - at Array.forEach () - - console.debug - DataChannel transport capabilities [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - - at Store.debug (src/store/pnp.js:505:13) - - console.debug - mutation.type PEER_AUTHENTICATING - - at debug (tests/unit/store/pnp-actions.spec.js:762:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:763:15) - at Array.forEach () - - console.debug - mutation.type USER_MESSAGE - - at debug (tests/unit/store/pnp-actions.spec.js:762:15) - at Array.forEach () - - console.debug - mutation.payload Authenticating remote peer: a_new_remote_peer_id - - at debug (tests/unit/store/pnp-actions.spec.js:763:15) - at Array.forEach () - - console.log - Authenticating remote Peer ID: a_new_remote_peer_id - - at Store.log (src/store/pnp.js:473:13) - - console.debug - mock get { url: 'http://localhost:8778' } - - at PeerFetch.debug (tests/unit/store/pnp-actions.spec.js:738:17) - - console.log - PEER_AUTHENTICATE { - request: { url: 'http://localhost:8778' }, - response: [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - header: [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - status: 200 - } - } - } - - at Store.log (src/store/pnp.js:480:15) - - console.log - PEER_AUTHENTICATE status OK - - at Store.log (src/store/pnp.js:482:17) - - console.debug - mock textDecode undefined - - at PeerFetch.debug (tests/unit/store/pnp-actions.spec.js:748:17) - - console.log - PEER_AUTHENTICATE response body OK = true - - at Store.log (src/store/pnp.js:487:17) - - console.debug - mutation.type PEER_CONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:762:15) - at Array.forEach () - - console.debug - mutation.payload [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)], - dataChannel: [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - }, - peer: 'a_new_remote_peer_id' - } - - at debug (tests/unit/store/pnp-actions.spec.js:763:15) - at Array.forEach () - - console.debug - NEW_REMOTE_PEER_ID: Setting state.remotePeerId to : a_new_remote_peer_id - - at Store.debug (src/store/pnp.js:135:13) - at Array.forEach () - - console.debug - mutation.type NEW_REMOTE_PEER_ID - - at debug (tests/unit/store/pnp-actions.spec.js:762:15) - at Array.forEach () - - console.debug - mutation.payload a_new_remote_peer_id - - at debug (tests/unit/store/pnp-actions.spec.js:763:15) - at Array.forEach () - - console.debug - DataChannel transport capabilities [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - - at Store.debug (src/store/pnp.js:505:13) - - console.debug - window.localStorage Storage {} - - at Object.debug (tests/unit/store/pnp-actions.spec.js:770:13) - - console.debug - mutation.type PEER_AUTHENTICATING - - at debug (tests/unit/store/pnp-actions.spec.js:799:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:800:15) - at Array.forEach () - - console.debug - mutation.type USER_MESSAGE - - at debug (tests/unit/store/pnp-actions.spec.js:799:15) - at Array.forEach () - - console.debug - mutation.payload Authenticating remote peer: a_new_remote_peer_id - - at debug (tests/unit/store/pnp-actions.spec.js:800:15) - at Array.forEach () - - console.log - Authenticating remote Peer ID: a_new_remote_peer_id - - at Store.log (src/store/pnp.js:473:13) - - console.log - peerFetch.get() Error while connecting to remote peer ID: a_new_remote_peer_id Error: Problem occured during peer discovery. - at PeerFetch. (/workspace/ambianic-ui/tests/unit/store/pnp-actions.spec.js:790:15) - at /workspace/ambianic-ui/node_modules/jest-mock/build/index.js:480:41 - at PeerFetch. (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:489:13) - at PeerFetch.mockConstructor (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:182:19) - at PeerFetch.get (eval at _createMockFunction (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:674:31), :3:47) - at /workspace/ambianic-ui/node_modules/jest-mock/build/index.js:485:35 - at PeerFetch. (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:489:13) - at PeerFetch.mockConstructor (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:182:19) - at PeerFetch.get (eval at _createMockFunction (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:674:31), :3:47) - at Store.get (/workspace/ambianic-ui/src/store/pnp.js:479:46) - at Array.wrappedActionHandler (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:849:23) - at Store.dispatch (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:514:15) - at Store.boundDispatch [as dispatch] (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:404:21) - at Object.dispatch (/workspace/ambianic-ui/tests/unit/store/pnp-actions.spec.js:802:17) - at Object.asyncJestTest (/workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) - at /workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:45:12 - at new Promise () - at mapper (/workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:28:19) - at /workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:75:41 - at processTicksAndRejections (node:internal/process/task_queues:94:5) - - at Store.log (src/store/pnp.js:490:15) - - console.debug - mutation.type USER_MESSAGE - - at debug (tests/unit/store/pnp-actions.spec.js:799:15) - at Array.forEach () - - console.debug - mutation.payload Remote peer authentication failed. - - at debug (tests/unit/store/pnp-actions.spec.js:800:15) - at Array.forEach () - - console.info - ######>>>>>>> p2p connection error Remote peer authentication faied. - - at Store.info (src/store/pnp.js:552:13) - - console.info - Problematic remote peer ID: a_new_remote_peer_id - - at Store.info (src/store/pnp.js:553:13) - - console.debug - mutation.type PEER_CONNECTION_ERROR - - at debug (tests/unit/store/pnp-actions.spec.js:799:15) - at Array.forEach () - - console.debug - mutation.payload Remote peer authentication faied. - - at debug (tests/unit/store/pnp-actions.spec.js:800:15) - at Array.forEach () - - console.info - Will try a new connection shortly. - - at Store.info (src/store/pnp.js:556:13) - - console.debug - mutation.type PEER_DISCONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:799:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:800:15) - at Array.forEach () - - console.debug - DataChannel transport capabilities [Function: mockConstructor] { - _isMockFunction: true, - getMockImplementation: [Function (anonymous)], - mock: [Getter/Setter], - mockClear: [Function (anonymous)], - mockReset: [Function (anonymous)], - mockRestore: [Function (anonymous)], - mockReturnValueOnce: [Function (anonymous)], - mockResolvedValueOnce: [Function (anonymous)], - mockRejectedValueOnce: [Function (anonymous)], - mockReturnValue: [Function (anonymous)], - mockResolvedValue: [Function (anonymous)], - mockRejectedValue: [Function (anonymous)], - mockImplementationOnce: [Function (anonymous)], - mockImplementation: [Function (anonymous)], - mockReturnThis: [Function (anonymous)], - mockName: [Function (anonymous)], - getMockName: [Function (anonymous)] - } - - at Store.debug (src/store/pnp.js:505:13) - - console.debug - NEW_REMOTE_PEER_ID: Setting state.remotePeerId to : a_new_remote_peer_id - - at Store.debug (src/store/pnp.js:135:13) - at Array.forEach () - - console.debug - mutation.type NEW_REMOTE_PEER_ID - - at debug (tests/unit/store/pnp-actions.spec.js:821:15) - at Array.forEach () - - console.debug - mutation.payload a_new_remote_peer_id - - at debug (tests/unit/store/pnp-actions.spec.js:822:15) - at Array.forEach () - - console.debug - mutation.type PEER_DISCONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:821:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:822:15) - at Array.forEach () - - console.log - PNP Service disconnected. Reconnecting... - - at Store.log (src/store/pnp.js:420:15) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.log - BUG WORKAROUND: Peer lost ID. Resetting to last known ID. - - at Store.log (src/store/pnp.js:358:15) - - console.debug - mutation.type PNP_SERVICE_CONNECTING - - at debug (tests/unit/store/pnp-actions.spec.js:821:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:822:15) - at Array.forEach () - - console.debug - #####>>>> PNP Service connection status: PNP_SERVICE_CONNECTING - - at Store.debug (src/store/pnp.js:430:13) - - console.debug - #####>>>>>>> Connecting to remote peer a_new_remote_peer_id - - at Store.debug (src/store/pnp.js:431:13) - - console.info - >>>>>> Opening new peer connection. - - at Store.info (src/store/pnp.js:437:13) - - console.debug - mutation.type PEER_CONNECTING - - at debug (tests/unit/store/pnp-actions.spec.js:821:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:822:15) - at Array.forEach () - - console.debug - peerConnection.on(event) handlers all set. - - at debug (src/store/pnp.js:300:11) - - console.debug - mutation.type PEER_DISCONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:848:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:849:15) - at Array.forEach () - - console.debug - REMOTE_PEER_ID_REMOVED: Removing remote Peer Id from local storage - - at Store.debug (src/store/pnp.js:140:13) - at Array.forEach () - - console.debug - mutation.type REMOTE_PEER_ID_REMOVED - - at debug (tests/unit/store/pnp-actions.spec.js:848:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:849:15) - at Array.forEach () - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.debug - mutation.type PEER_DISCOVERING - - at debug (tests/unit/store/pnp-actions.spec.js:848:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:849:15) - at Array.forEach () - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - PNP Service disconnected. Reconnecting... - - at log (src/store/pnp.js:383:17) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.log - BUG WORKAROUND: Peer lost ID. Resetting to last known ID. - - at Store.log (src/store/pnp.js:358:15) - - console.debug - mutation.type PNP_SERVICE_CONNECTING - - at debug (tests/unit/store/pnp-actions.spec.js:848:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:849:15) - at Array.forEach () - - console.log - PNP Service still not connected. Will retry shortly. - - at log (src/store/pnp.js:393:19) - - console.debug - Error while closing peer DataConnection. Error: Error while closing peerConnection. - at Function. (/workspace/ambianic-ui/tests/unit/store/pnp-actions.spec.js:869:15) - at /workspace/ambianic-ui/node_modules/jest-mock/build/index.js:480:41 - at Function. (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:489:13) - at Function.mockConstructor [as close] (/workspace/ambianic-ui/node_modules/jest-mock/build/index.js:182:19) - at Store.close (/workspace/ambianic-ui/src/store/pnp.js:541:16) - at Array.wrappedActionHandler (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:849:23) - at Store.dispatch (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:514:15) - at Store.boundDispatch [as dispatch] (/workspace/ambianic-ui/node_modules/vuex/dist/vuex.common.js:404:21) - at Object.dispatch (/workspace/ambianic-ui/tests/unit/store/pnp-actions.spec.js:879:17) - at Object.asyncJestTest (/workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) - at /workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:45:12 - at new Promise () - at mapper (/workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:28:19) - at /workspace/ambianic-ui/node_modules/jest/node_modules/jest-jasmine2/build/queueRunner.js:75:41 - at processTicksAndRejections (node:internal/process/task_queues:94:5) - - at Store.debug (src/store/pnp.js:543:19) - - console.debug - mutation.type PEER_DISCONNECTED - - at debug (tests/unit/store/pnp-actions.spec.js:876:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:877:15) - at Array.forEach () - - console.debug - REMOTE_PEER_ID_REMOVED: Removing remote Peer Id from local storage - - at Store.debug (src/store/pnp.js:140:13) - at Array.forEach () - - console.debug - mutation.type REMOTE_PEER_ID_REMOVED - - at debug (tests/unit/store/pnp-actions.spec.js:876:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:877:15) - at Array.forEach () - - console.log - ######## >>>>> peerConnectionStatus = PEER_DISCONNECTED - - at Store.log (src/store/pnp.js:370:13) - - console.debug - mutation.type PEER_DISCOVERING - - at debug (tests/unit/store/pnp-actions.spec.js:876:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:877:15) - at Array.forEach () - - console.log - Discovering remote peer... - - at log (src/store/pnp.js:379:15) - - console.log - PNP Service disconnected. Reconnecting... - - at log (src/store/pnp.js:383:17) - - console.log - pnp client: reconnecting peer... - - at Store.log (src/store/pnp.js:355:13) - - console.log - BUG WORKAROUND: Peer lost ID. Resetting to last known ID. - - at Store.log (src/store/pnp.js:358:15) - - console.debug - mutation.type PNP_SERVICE_CONNECTING - - at debug (tests/unit/store/pnp-actions.spec.js:876:15) - at Array.forEach () - - console.debug - mutation.payload undefined - - at debug (tests/unit/store/pnp-actions.spec.js:877:15) - at Array.forEach () - - console.log - PNP Service still not connected. Will retry shortly. - - at log (src/store/pnp.js:393:19) - --------------------------|---------|----------|---------|---------|--------------------- -File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s --------------------------|---------|----------|---------|---------|--------------------- -All files | 38.34 | 29.03 | 29.53 | 38.61 | - src | 50 | 100 | 100 | 50 | - App.vue | 0 | 100 | 100 | 0 | 19 - config.js | 100 | 100 | 100 | 100 | - src/components | 0 | 0 | 0 | 0 | - AppFrame.vue | 0 | 100 | 0 | 0 | 29-36 - DetectionBoxes.vue | 0 | 0 | 0 | 0 | 43-96 - NavBar.vue | 0 | 100 | 0 | 0 | 172-228 - UpdateNotification.vue | 0 | 100 | 0 | 0 | 21-35 - src/components/shared | 0 | 100 | 0 | 0 | - ListItem.vue | 0 | 100 | 0 | 0 | 96 - src/remote | 0 | 0 | 0 | 0 | - peer-fetch.js | 0 | 0 | 0 | 0 | 8-301 - peer-room.js | 0 | 0 | 0 | 0 | 10-84 - src/store | 98.35 | 86.54 | 97.78 | 100 | - action-types.js | 100 | 100 | 100 | 100 | - mutation-types.js | 100 | 100 | 100 | 100 | - pnp.js | 98.16 | 86.54 | 97.78 | 100 | 207-352,481,537-539 - src/views | 0 | 0 | 0 | 0 | - About.vue | 0 | 100 | 0 | 0 | 74-83 - Feedback.vue | 0 | 100 | 100 | 0 | 41 - Help.vue | 0 | 100 | 100 | 0 | 61 - Home.vue | 0 | 0 | 0 | 0 | 84-106 - Onboarding.vue | 0 | 0 | 0 | 0 | 586-724 - Settings.vue | 0 | 0 | 0 | 0 | 268-359 - Timeline.vue | 0 | 0 | 0 | 0 | 227-467 --------------------------|---------|----------|---------|---------|--------------------- - -Test Suites: 1 failed, 1 passed, 2 total -Tests: 1 failed, 45 passed, 46 total -Snapshots: 0 total -Time: 9.248 s -Ran all test suites matching /tests\/unit\/store\//i. -npm ERR! code ELIFECYCLE -npm ERR! errno 1 -npm ERR! ambianic-ui@2.14.1 test:unit: `jest "tests/unit/store/"` -npm ERR! Exit status 1 -npm ERR! -npm ERR! Failed at the ambianic-ui@2.14.1 test:unit script. -npm ERR! This is probably not a problem with npm. There is likely additional logging output above. - -npm ERR! A complete log of this run can be found in: -npm ERR! /home/gitpod/.npm/_logs/2021-04-23T16_37_44_160Z-debug.log From f74c3f7dc34641b2e14bfeb57f6eac74336a897f Mon Sep 17 00:00:00 2001 From: ivelin Date: Mon, 11 Oct 2021 17:48:43 +0000 Subject: [PATCH 04/47] checkpoint: fixing discovery side effect errors Signed-off-by: ivelin --- package-lock.json | 389 ++++++++++++++++++++++++++++------------------ package.json | 20 +-- src/store/pnp.js | 38 +++-- 3 files changed, 275 insertions(+), 172 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c037b89..8c849ae0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ambianic-ui", - "version": "2.19.3", + "version": "2.20.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1044,17 +1044,48 @@ "semver": "^5.5.0" }, "dependencies": { + "@babel/helper-compilation-targets": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", + "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.15.0", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.16.6", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz", - "integrity": "sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz", + "integrity": "sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg==", "dev": true, "requires": { - "@babel/compat-data": "^7.14.7", - "@babel/helper-compilation-targets": "^7.14.5", + "@babel/compat-data": "^7.15.0", + "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.14.5" + "@babel/plugin-transform-parameters": "^7.15.4" + }, + "dependencies": { + "@babel/plugin-transform-parameters": { + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz", + "integrity": "sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + } } } } @@ -1182,20 +1213,28 @@ } }, "@cypress/code-coverage": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-3.9.10.tgz", - "integrity": "sha512-aJokd9B1/cI8uQAH4tPw9yuZg7a/bdl1xO4xSeO4ly5Tlj8L3/eJ2vvJf5RcfHAZQE1OMOYY7ZtPuBBE8eItYw==", + "version": "3.9.11", + "resolved": "https://registry.npmjs.org/@cypress/code-coverage/-/code-coverage-3.9.11.tgz", + "integrity": "sha512-SA+fPILiiE0UHlMAwuv592D+wbKKdLbXz7BAN2a2RvW4fLbkVn1dXLATUFYf/6LkKrLaXJ3RENsoW9JqjBLzeQ==", "dev": true, "requires": { "@cypress/browserify-preprocessor": "3.0.1", "chalk": "4.1.2", - "dayjs": "1.10.6", + "dayjs": "1.10.7", "debug": "4.3.2", "execa": "4.1.0", "globby": "11.0.4", "istanbul-lib-coverage": "3.0.0", "js-yaml": "3.14.1", "nyc": "15.1.0" + }, + "dependencies": { + "dayjs": { + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", + "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==", + "dev": true + } } }, "@cypress/request": { @@ -1226,9 +1265,9 @@ } }, "@cypress/webpack-dev-server": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@cypress/webpack-dev-server/-/webpack-dev-server-1.5.0.tgz", - "integrity": "sha512-uRkMYUOnJsP66jGsN82usLPIv/HOfrlca0EJnZOn4OIdFHSzRnno9Ngc7FM5FihWnkZqRubZpLUpGV/ZtCR09w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@cypress/webpack-dev-server/-/webpack-dev-server-1.6.0.tgz", + "integrity": "sha512-FBhBYm5HZIzaB7iMblWLi2um8peC6HX7OASYk+Qgjo9fVlXNweHU0BA0Bwr8soxnceIxH9QxzdgkvGfgWD3AFA==", "requires": { "debug": "4.3.2", "semver": "^7.3.4", @@ -5861,6 +5900,18 @@ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "optional": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -5920,6 +5971,75 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "vue-loader-v16": { + "version": "npm:vue-loader@16.8.1", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.1.tgz", + "integrity": "sha512-V53TJbHmzjBhCG5OYI2JWy/aYDspz4oVHKxS43Iy212GjGIG1T3EsB3+GWXFm/1z5VwjdjLmdZUFYM70y77vtQ==", + "dev": true, + "optional": true, + "requires": { + "chalk": "^4.1.0", + "hash-sum": "^2.0.0", + "loader-utils": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "optional": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "optional": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "webpack-bundle-analyzer": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.9.0.tgz", @@ -8526,12 +8646,6 @@ "string-width": "^4.2.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -8570,12 +8684,6 @@ "string-width": "^4.2.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -10129,9 +10237,9 @@ "dev": true }, "dayjs": { - "version": "1.10.6", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz", - "integrity": "sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw==", + "version": "1.10.7", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.7.tgz", + "integrity": "sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==", "dev": true }, "de-indent": { @@ -11177,9 +11285,9 @@ } }, "eslint-plugin-cypress": { - "version": "2.11.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.11.3.tgz", - "integrity": "sha512-hOoAid+XNFtpvOzZSNWP5LDrQBEJwbZwjib4XJ1KcRYKjeVj0mAmPmucG4Egli4j/aruv+Ow/acacoloWWCl9Q==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz", + "integrity": "sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==", "dev": true, "requires": { "globals": "^11.12.0" @@ -11388,9 +11496,9 @@ "dev": true }, "eslint-plugin-vue": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.17.0.tgz", - "integrity": "sha512-Rq5R2QetDCgC+kBFQw1+aJ5B93tQ4xqZvoCUxuIzwTonngNArsdP8ChM8PowIzsJvRtWl4ltGh/bZcN3xhFWSw==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-7.19.1.tgz", + "integrity": "sha512-e2pD7nW2sTY04ThH+66BgToNwC4n6dqfNhKE+ypdJFtZgn3Zn+nP8ZEIFPG0PGqCKQ3qxy8dJk1bzUsuQd3ANA==", "dev": true, "requires": { "eslint-utils": "^2.1.0", @@ -12167,9 +12275,9 @@ "dev": true }, "fast-safe-stringify": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", - "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true }, "fast-url-parser": { @@ -13322,9 +13430,9 @@ } }, "idb": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/idb/-/idb-6.1.3.tgz", - "integrity": "sha512-oIRDpVcs5KXpI1hRnTJUwkY63RB/7iqu9nSNuzXN8TLHjs7oO20IoPFbBTsqxIL5IjzIUDi+FXlVcK4zm26J8A==" + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/idb/-/idb-6.1.4.tgz", + "integrity": "sha512-DshI5yxIB3NYc47cPpfipYX8MSIgQPqVR+WoaGI9EDq6cnLGgGYR1fp6z8/Bq9vMS8Jq1bS3eWUgXpFO5+ypSA==" }, "ieee754": { "version": "1.2.1", @@ -17854,12 +17962,6 @@ "wrap-ansi": "^7.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, "colorette": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", @@ -18948,9 +19050,9 @@ } }, "node": { - "version": "16.6.1", - "resolved": "https://registry.npmjs.org/node/-/node-16.6.1.tgz", - "integrity": "sha512-qlIQ5vkAAMP+T1bYivwngIqZlUzerPSeaeAQVUvyQ2XZ8WN86ZUdzcpkW/iuEnP9paNcpAsA4p9yCsfrdjG7YQ==", + "version": "16.10.0", + "resolved": "https://registry.npmjs.org/node/-/node-16.10.0.tgz", + "integrity": "sha512-SXcqz3j4AOFMPPsd0bXDpQY95Xm8mnJ7PbBhJKEvp+aPYoVH38QAHha59EAuRaiASaSLWt5sP0oDCMzzaSmEAA==", "requires": { "node-bin-setup": "^1.0.0" } @@ -19224,14 +19326,15 @@ "dev": true }, "npm": { - "version": "7.21.1", - "resolved": "https://registry.npmjs.org/npm/-/npm-7.21.1.tgz", - "integrity": "sha512-k7XQNHGHAp0VowMMUMRMtntxWatNad9hhYrelUKDPvZ++DBxvofA8QTNPiuMKtx8CBOFA8iJ4aizhbx6ZYVfzQ==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/npm/-/npm-7.24.2.tgz", + "integrity": "sha512-120p116CE8VMMZ+hk8IAb1inCPk4Dj3VZw29/n2g6UI77urJKVYb7FZUDW8hY+EBnfsjI/2yrobBgFyzo7YpVQ==", "dev": true, "requires": { - "@npmcli/arborist": "^2.8.2", + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/arborist": "^2.9.0", "@npmcli/ci-detect": "^1.2.0", - "@npmcli/config": "^2.2.0", + "@npmcli/config": "^2.3.0", "@npmcli/map-workspaces": "^1.0.4", "@npmcli/package-json": "^1.0.1", "@npmcli/run-script": "^1.8.6", @@ -19246,11 +19349,11 @@ "cli-table3": "^0.6.0", "columnify": "~1.5.4", "fastest-levenshtein": "^1.0.12", - "glob": "^7.1.7", + "glob": "^7.2.0", "graceful-fs": "^4.2.8", "hosted-git-info": "^4.0.2", "ini": "^2.0.0", - "init-package-json": "^2.0.4", + "init-package-json": "^2.0.5", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", "libnpmaccess": "^4.0.2", @@ -19273,18 +19376,19 @@ "node-gyp": "^7.1.2", "nopt": "^5.0.0", "npm-audit-report": "^2.1.5", + "npm-install-checks": "^4.0.0", "npm-package-arg": "^8.1.5", "npm-pick-manifest": "^6.1.1", "npm-profile": "^5.0.3", "npm-registry-fetch": "^11.0.0", "npm-user-validate": "^1.0.1", - "npmlog": "^5.0.0", + "npmlog": "^5.0.1", "opener": "^1.5.2", "pacote": "^11.3.5", "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", "read": "~1.0.7", - "read-package-json": "^4.0.1", + "read-package-json": "^4.1.1", "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", @@ -19304,11 +19408,17 @@ "bundled": true, "dev": true }, + "@isaacs/string-locale-compare": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, "@npmcli/arborist": { - "version": "2.8.2", + "version": "2.9.0", "bundled": true, "dev": true, "requires": { + "@isaacs/string-locale-compare": "^1.0.1", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^1.0.2", "@npmcli/metavuln-calculator": "^1.1.0", @@ -19348,7 +19458,7 @@ "dev": true }, "@npmcli/config": { - "version": "2.2.0", + "version": "2.3.0", "bundled": true, "dev": true, "requires": { @@ -19549,12 +19659,12 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.5", + "version": "1.1.6", "bundled": true, "dev": true, "requires": { "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "readable-stream": "^3.6.0" } }, "asap": { @@ -19991,7 +20101,7 @@ } }, "glob": { - "version": "7.1.7", + "version": "7.2.0", "bundled": true, "dev": true, "requires": { @@ -20142,15 +20252,14 @@ "dev": true }, "init-package-json": { - "version": "2.0.4", + "version": "2.0.5", "bundled": true, "dev": true, "requires": { - "glob": "^7.1.1", - "npm-package-arg": "^8.1.2", + "npm-package-arg": "^8.1.5", "promzard": "^0.3.0", "read": "~1.0.1", - "read-package-json": "^4.0.0", + "read-package-json": "^4.1.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^3.0.0" @@ -20175,7 +20284,7 @@ } }, "is-core-module": { - "version": "2.6.0", + "version": "2.7.0", "bundled": true, "dev": true, "requires": { @@ -20197,11 +20306,6 @@ "bundled": true, "dev": true }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "isexe": { "version": "2.0.0", "bundled": true, @@ -20442,7 +20546,7 @@ } }, "minipass": { - "version": "3.1.3", + "version": "3.1.5", "bundled": true, "dev": true, "requires": { @@ -20458,7 +20562,7 @@ } }, "minipass-fetch": { - "version": "1.3.4", + "version": "1.4.1", "bundled": true, "dev": true, "requires": { @@ -20715,14 +20819,25 @@ "dev": true }, "npmlog": { - "version": "5.0.0", + "version": "5.0.1", "bundled": true, "dev": true, "requires": { - "are-we-there-yet": "^1.1.5", + "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", "gauge": "^3.0.0", "set-blocking": "^2.0.0" + }, + "dependencies": { + "are-we-there-yet": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + } } }, "number-is-nan": { @@ -20812,11 +20927,6 @@ "bundled": true, "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, "promise-all-reject-late": { "version": "1.0.1", "bundled": true, @@ -20883,7 +20993,7 @@ "dev": true }, "read-package-json": { - "version": "4.0.1", + "version": "4.1.1", "bundled": true, "dev": true, "requires": { @@ -20903,17 +21013,13 @@ } }, "readable-stream": { - "version": "2.3.7", + "version": "3.6.0", "bundled": true, "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdir-scoped-modules": { @@ -20989,7 +21095,7 @@ } }, "safe-buffer": { - "version": "5.1.2", + "version": "5.2.1", "bundled": true, "dev": true }, @@ -21031,7 +21137,7 @@ } }, "socks-proxy-agent": { - "version": "6.0.0", + "version": "6.1.0", "bundled": true, "dev": true, "requires": { @@ -21117,11 +21223,11 @@ } }, "string_decoder": { - "version": "1.1.1", + "version": "1.3.0", "bundled": true, "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, "stringify-package": { @@ -21326,24 +21432,35 @@ } }, "null-loader": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/null-loader/-/null-loader-3.0.0.tgz", - "integrity": "sha512-hf5sNLl8xdRho4UPBOOeoIwT3WhjYcMUQm0zj44EhD6UscMAz72o2udpoDFBgykucdEDGIcd6SXbc/G6zssbzw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/null-loader/-/null-loader-4.0.1.tgz", + "integrity": "sha512-pxqVbi4U6N26lq+LmgIbB5XATP0VdZKOG25DhHi8btMmJJefGArFyDg1yc4U3hWCJbMqSrw0qyrz1UQX+qYXqg==", "dev": true, "requires": { - "loader-utils": "^1.2.3", - "schema-utils": "^1.0.0" + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" }, "dependencies": { + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } } } @@ -24329,9 +24446,9 @@ } }, "sass": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.39.0.tgz", - "integrity": "sha512-F4o+RhJkNOIG0b6QudYU8c78ZADKZjKDk5cyrf8XTKWfrgbtyVVXImFstJrc+1pkQDCggyidIOytq6gS4gCCZg==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.42.1.tgz", + "integrity": "sha512-/zvGoN8B7dspKc5mC6HlaygyCBRvnyzzgD5khiaCfglWztY99cYoiTUksVx11NlnemrcfH5CEaCpsUKoW0cQqg==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0" @@ -27302,12 +27419,12 @@ "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==" }, "vue-cli-plugin-vuetify": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.4.2.tgz", - "integrity": "sha512-aJXkzz3CbN/D1/aJ53slsp8hGaruQHhj/mkNjsfpkqhGglLex7UBnvcDwi5+D1tNk+XlddANLgRe9tmCFMorVA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-vuetify/-/vue-cli-plugin-vuetify-2.4.3.tgz", + "integrity": "sha512-dT9KpH1rXT6UWzBDFLMB69sgrNCoWFcxWiIyDDZ4vikv85JDweMHh2dT5n6QaAt7qsGlvL4IMOopjcyUTiPW9g==", "dev": true, "requires": { - "null-loader": "^3.0.0", + "null-loader": "^4.0.1", "semver": "^7.1.2", "shelljs": "^0.8.3" }, @@ -27348,17 +27465,17 @@ } }, "vue-clipboard2": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/vue-clipboard2/-/vue-clipboard2-0.3.1.tgz", - "integrity": "sha512-H5S/agEDj0kXjUb5GP2c0hCzIXWRBygaWLN3NEFsaI9I3uWin778SFEMt8QRXiPG+7anyjqWiw2lqcxWUSfkYg==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz", + "integrity": "sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw==", "requires": { "clipboard": "^2.0.0" } }, "vue-eslint-parser": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.10.0.tgz", - "integrity": "sha512-7tc/ewS9Vq9Bn741pvpg8op2fWJPH3k32aL+jcIcWGCTzh/zXSdh7pZ5FV3W2aJancP9+ftPAv292zY5T5IPCg==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.11.0.tgz", + "integrity": "sha512-qh3VhDLeh773wjgNTl7ss0VejY9bMMa0GoDG2fQVyDzRFdiU3L7fw74tWZDHNQXdZqxO3EveQroa9ct39D2nqg==", "dev": true, "requires": { "debug": "^4.1.1", @@ -27503,32 +27620,6 @@ } } }, - "vue-loader-v16": { - "version": "npm:vue-loader@16.8.1", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.1.tgz", - "integrity": "sha512-V53TJbHmzjBhCG5OYI2JWy/aYDspz4oVHKxS43Iy212GjGIG1T3EsB3+GWXFm/1z5VwjdjLmdZUFYM70y77vtQ==", - "dev": true, - "optional": true, - "requires": { - "chalk": "^4.1.0", - "hash-sum": "^2.0.0", - "loader-utils": "^2.0.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "optional": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - } - } - }, "vue-observe-visibility": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/vue-observe-visibility/-/vue-observe-visibility-1.0.0.tgz", @@ -27597,9 +27688,9 @@ } }, "vuetify": { - "version": "2.5.8", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.5.8.tgz", - "integrity": "sha512-paLmNhKTYFD41+14rIHnCo+P1jHbUzwBiMowxs5qXVq8RdRMqRmcy05Sfse1WUu90amPGK2fIFQq5rL2N8zqZg==" + "version": "2.5.9", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.5.9.tgz", + "integrity": "sha512-rQaa8MDxnv449l+XCmFCN9bRQpCUT8mewW6yIc6DHiXh9bAneD6jXF023doK0KkcS8+vRSrtgBESsLYA6te+dg==" }, "vuetify-loader": { "version": "1.7.3", diff --git a/package.json b/package.json index 430a073b..38d922e9 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,17 @@ "test": "npm run test:unit && npm run test:e2e && npm run coverage" }, "dependencies": { - "@cypress/webpack-dev-server": "^1.5.0", + "@cypress/webpack-dev-server": "^1.6.0", "@vue/babel-preset-app": "^4.5.10", "compression-webpack-plugin": "^6.1.1", - "idb": "^6.1.3", + "idb": "^6.1.4", "konva": "^7.2.5", "moment": "^2.26.0", - "node": "^16.6.1", + "node": "^16.10.0", "peerjs": "^1.3.2", "register-service-worker": "^1.7.1", "vue": "^2.6.14", - "vue-clipboard2": "^0.3.1", + "vue-clipboard2": "^0.3.3", "vue-infinite-loading": "^2.4.5", "vue-konva": "^2.1.3", "vue-observe-visibility": "^1.0.0", @@ -37,11 +37,11 @@ "vue-resize-directive": "^1.2.0", "vue-router": "^3.5.2", "vue-worker": "^1.2.1", - "vuetify": "^2.5.8", + "vuetify": "^2.5.9", "vuex": "^3.6.2" }, "devDependencies": { - "@cypress/code-coverage": "^3.9.10", + "@cypress/code-coverage": "^3.9.11", "@semantic-release/changelog": "^5.0.1", "@semantic-release/commit-analyzer": "^8.0.1", "@semantic-release/exec": "^5.0.0", @@ -64,12 +64,12 @@ "codecov": "^3.8.1", "cypress": "^8.5.0", "eslint": "^7.32.0", - "eslint-plugin-cypress": "^2.11.3", + "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.24.2", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^5.0.0", - "eslint-plugin-vue": "^7.17.0", + "eslint-plugin-vue": "^7.19.1", "fs-vacuum": "^1.2.10", "husky": "^7.0.2", "istanbul-lib-coverage": "^3.0.0", @@ -78,12 +78,12 @@ "jest-fetch-mock": "^3.0.3", "lodash": "^4.17.21", "nyc": "^15.0.1", - "sass": "^1.39.0", + "sass": "^1.42.1", "sass-loader": "^10.2.0", "semantic-release": "^17.4.7", "stylus": "^0.54.7", "stylus-loader": "^3.0.2", - "vue-cli-plugin-vuetify": "^2.4.2", + "vue-cli-plugin-vuetify": "^2.4.3", "vue-cli-plugin-webpack-bundle-analyzer": "~4.0.0", "vue-jest": "^3.0.5", "vue-template-compiler": "^2.6.14", diff --git a/src/store/pnp.js b/src/store/pnp.js index 84d31d5b..76a50e5f 100644 --- a/src/store/pnp.js +++ b/src/store/pnp.js @@ -445,7 +445,7 @@ const actions = { if (state.peerConnection) { // make sure any previous connection is closed and cleaned up console.info('>>>>>>> Closing and cleaning up existing peer connection.') - state.peerConnection.close() + await state.peerConnection.close() } console.info('>>>>>> Opening new peer connection.') const peer = state.peer @@ -457,17 +457,29 @@ const actions = { // the remote peer is not available or the networking stack got corrupted. // Let's mark the remote peer as problematic temporarily and reset the webrtc stack. const hungupConnectionResetTimer = setTimeout(async () => { - try { - state.problematicRemotePeers.add(remotePeerId) - console.debug('Problematic remote peer ID:', remotePeerId) - await peer.disconnect() - await peer.destroy() - } catch (err) { - console.warn('Error destroying peer.') - } finally { - console.info('It took too long to setup a connection. Resetting peer.') - await dispatch(INITIALIZE_PNP) - } + // TODO: Move this logic into the app on a standalone page with a modal dialog for new peer discovery. + // + // The logic in the section below was commented out on Oct 11, 2021 because it was part of + // a async backend logic which allowed for an explosion of possible branches and edge cases to handle. + // + // When the user is allowed to move around the UI and trigger other connectivity + // related events in the middle of a peer discovery process, that + // causes too many unplannedside effects. + // + // try { + // state.problematicRemotePeers.add(remotePeerId) + // console.debug('Problematic remote peer ID:', remotePeerId) + // if (state.peerConnection) { + // // make sure any previous connection is closed and cleaned up + // console.info('>>>>>>> Closing and cleaning up existing peer connection.') + // await state.peerConnection.close() + // } + // } catch (err) { + // console.warn('Error destroying peer.') + // } finally { + // console.info('It took too long to setup a connection. Resetting peer.') + // await dispatch(INITIALIZE_PNP) + // } }, 30 * 1000) // 30 seconds timeout setPeerConnectionHandlers({ state, @@ -537,7 +549,7 @@ const actions = { * them or let them connect to you. */ async [CHANGE_REMOTE_PEER_ID] ({ state, commit, dispatch }, remotePeerId) { - commit(PEER_DISCONNECTED) + await dispatch(REMOVE_REMOTE_PEER_ID) commit(NEW_REMOTE_PEER_ID, remotePeerId) await dispatch(PEER_CONNECT, remotePeerId) }, From edd106bebefe0d563b834dba890f06779d563d69 Mon Sep 17 00:00:00 2001 From: ivelin Date: Mon, 18 Oct 2021 18:54:40 +0000 Subject: [PATCH 05/47] chore: checkpoint Signed-off-by: ivelin --- package-lock.json | 12 +- package.json | 2 +- src/components/AppFrame.vue | 15 +- src/components/NavBar.vue | 27 -- src/components/shared/ConnectionModal.vue | 43 ++ ...ackNotification.vue => StatusSnackbar.vue} | 4 +- src/store/mutation-types.js | 2 + src/store/pnp.js | 79 ++- src/views/AddDevice.vue | 420 ++++++++++++++++ src/views/DeviceCard.vue | 243 ++++++++++ src/views/Settings.vue | 459 ++++-------------- 11 files changed, 852 insertions(+), 454 deletions(-) create mode 100644 src/components/shared/ConnectionModal.vue rename src/components/shared/{snackNotification.vue => StatusSnackbar.vue} (96%) create mode 100644 src/views/AddDevice.vue create mode 100644 src/views/DeviceCard.vue diff --git a/package-lock.json b/package-lock.json index 8c849ae0..938f2943 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10114,9 +10114,9 @@ "dev": true }, "cypress": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-8.5.0.tgz", - "integrity": "sha512-MMkXIS+Ro2KETn4gAlG3tIc/7FiljuuCZP0zpd9QsRG6MZSyZW/l1J3D4iQM6WHsVxuX4rFChn5jPFlC2tNSvQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-8.6.0.tgz", + "integrity": "sha512-F7qEK/6Go5FsqTueR+0wEw2vOVKNgk5847Mys8vsWkzPoEKdxs+7N9Y1dit+zhaZCLtMPyrMwjfA53ZFy+lSww==", "dev": true, "requires": { "@cypress/request": "^2.88.6", @@ -10164,9 +10164,9 @@ }, "dependencies": { "@types/node": { - "version": "14.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", + "version": "14.17.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.27.tgz", + "integrity": "sha512-94+Ahf9IcaDuJTle/2b+wzvjmutxXAEXU6O81JHblYXUg2BDG+dnBy7VxIPHKAyEEDHzCMQydTJuWvrE+Aanzw==", "dev": true }, "bluebird": { diff --git a/package.json b/package.json index 38d922e9..832752b5 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "babel-plugin-istanbul": "^6.0.0", "babel-plugin-transform-imports": "^2.0.0", "codecov": "^3.8.1", - "cypress": "^8.5.0", + "cypress": "^8.6.0", "eslint": "^7.32.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-import": "^2.24.2", diff --git a/src/components/AppFrame.vue b/src/components/AppFrame.vue index 287fb482..67a76166 100644 --- a/src/components/AppFrame.vue +++ b/src/components/AppFrame.vue @@ -1,10 +1,15 @@ + + diff --git a/src/components/shared/snackNotification.vue b/src/components/shared/StatusSnackbar.vue similarity index 96% rename from src/components/shared/snackNotification.vue rename to src/components/shared/StatusSnackbar.vue index 82cabdc1..12eb8114 100644 --- a/src/components/shared/snackNotification.vue +++ b/src/components/shared/StatusSnackbar.vue @@ -1,5 +1,5 @@ @@ -180,7 +195,7 @@ import { PEER_CONNECTION_ERROR } from '@/store/mutation-types' import { - CHANGE_REMOTE_PEER_ID, PEER_CONNECT + CHANGE_REMOTE_PEER_ID } from '../store/action-types.js' export default { @@ -212,9 +227,6 @@ export default { ]), async selectAnotherEdgeDevice () { await this.$store.dispatch(CHANGE_REMOTE_PEER_ID, this.edgeAddress) - }, - async connectToSelectedEdgeDevice () { - await this.$store.dispatch(PEER_CONNECT, this.edgePeerId) } }, computed: { @@ -226,10 +238,7 @@ export default { pnp: state => state.pnp, edgePeerId: state => state.pnp.remotePeerId, peerFetch: state => state.pnp.peerFetch, - edgeDisplayName: state => { - const deviceLabel = (state.edgeDevice.edgeDisplayName) ? state.edgeDevice.edgeDisplayName : 'My Ambianic Edge Device' - return deviceLabel - } + edgeDisplayName: state => state.edgeDevice.edgeDisplayName }) }, watch: { From 5a5b6281cc6e84d3e4cade3aa38161818e02b379 Mon Sep 17 00:00:00 2001 From: ivelin Date: Wed, 20 Oct 2021 16:43:48 +0000 Subject: [PATCH 10/47] chore: checkpoint Signed-off-by: ivelin --- src/views/DeviceCard.vue | 44 ++++++++++++---------------------------- src/views/Settings.vue | 19 +++++++++-------- 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/views/DeviceCard.vue b/src/views/DeviceCard.vue index b64723c2..a768412d 100644 --- a/src/views/DeviceCard.vue +++ b/src/views/DeviceCard.vue @@ -23,33 +23,15 @@ - - - - - Syncing with Ambianic Edge device - - - - - - + @@ -71,7 +53,7 @@ v-if="isEdgeConnected" banner-class="text-left" icon="cloud-check-outline" - text="Ambianic Edge device connected!" + text="Device connected!" /> Timeline @@ -156,7 +137,7 @@ > - Forget Device + Forget Device? @@ -169,15 +150,16 @@ - Forget Device + Cancel - Cancel + Forget Device @@ -233,7 +215,7 @@ export default { return { edgeAddress: undefined, edgeDeviceError: null, - syncing: false, // is the UI in the process of syncing with remote device data + isSyncing: false, // is the UI in the process of syncing with remote device data rules: { required: value => !!value || 'Required.', counter: value => (value.length >= 5 && value.length <= 20) || 'Min 5 and Max 20 characters' @@ -273,7 +255,7 @@ export default { // trigger edit change callback // show blocking dialog with spinner https://vuetifyjs.com/en/components/dialogs/#loader // await dispatch to push new device display name: 1. to device, 2. to local device store - this.syncing = true + this.isSyncing = true await this.pnp.edgeAPI.setDeviceDisplayName(newDisplayName) this.$store.commit(EDGE_DEVICE_DISPLAY_NAME, newDisplayName) updated = true @@ -281,7 +263,7 @@ export default { this.edgeDeviceError = 'Error updating display name. Edge device offline or has outdated API.' console.error('Exception calling setDeviceDisplayName()', { e }) } finally { - this.syncing = false + this.isSyncing = false } } return updated diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 4b86c97c..ba9fe391 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -27,8 +27,7 @@ justify="center" v-if="edgePeerId" > - + @@ -40,8 +39,7 @@ Your current device selection - + - - Connected. - Not connected. + + + Connected. + + + Not connected. + - No Ambianic Edge devices added + Your devices Add and manage one or more Ambianic Edge devices. From 86fee275e474f17d3809c72929a10d069ea4dcb3 Mon Sep 17 00:00:00 2001 From: ivelin Date: Wed, 20 Oct 2021 17:14:20 +0000 Subject: [PATCH 11/47] chore: checkpoint Signed-off-by: ivelin --- src/views/AddDevice.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/AddDevice.vue b/src/views/AddDevice.vue index 93c05183..d6c57c25 100644 --- a/src/views/AddDevice.vue +++ b/src/views/AddDevice.vue @@ -145,8 +145,19 @@ + + + playlist_add_check_circle + + Success! + - Successfully added a new device. Continue to device timeline or configure settings. + Device successfully added to your list of managed devices. + Continue to device timeline or configure settings. Date: Wed, 20 Oct 2021 17:53:40 +0000 Subject: [PATCH 12/47] chore: checkpoint Signed-off-by: ivelin --- src/views/AddDevice.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/AddDevice.vue b/src/views/AddDevice.vue index d6c57c25..1612abaf 100644 --- a/src/views/AddDevice.vue +++ b/src/views/AddDevice.vue @@ -60,7 +60,9 @@ - Discover a device on the local WiFi network or connect remotely. +

+ Discover a device on the local WiFi network or connect remotely. +

Success!
- Device successfully added to your list of managed devices. - Continue to device timeline or configure settings. +

+ Device successfully added to your list of managed devices. + Continue to device timeline or configure settings. +

Date: Wed, 20 Oct 2021 19:06:23 +0000 Subject: [PATCH 13/47] chore: checkpoint Signed-off-by: ivelin --- src/views/AddDevice.vue | 231 ++++++++++++++++------------------------ 1 file changed, 91 insertions(+), 140 deletions(-) diff --git a/src/views/AddDevice.vue b/src/views/AddDevice.vue index 1612abaf..a2759681 100644 --- a/src/views/AddDevice.vue +++ b/src/views/AddDevice.vue @@ -72,7 +72,7 @@ Remote @@ -89,36 +89,70 @@ - - Local Devices - + - Local Devices + - - mdi-identifier - - - - - - - - + + + mdi-identifier + + + + + + + + + + Connect + + + + + + Remote device ID + + +

+ Enter the Peer ID of the remote Ambianic Edge device. +

+ +
+ + Connect @@ -184,106 +218,6 @@
- - - - Pair with local Ambianic Edge device - - - - - -

- [On by default] Discover and pair with an Ambianic Edge device on - your local network. This is the default pairing mode - that triggers automatically when you open this app for the first time. - Once paired and connected, you can access the Edge device remotely - from any Internet access point. -

-
- - - - - mdi-wifi - - - Discover on Local Network - - - - -
-
-
-
- - - - Pair with remote Ambianic Edge device - - - -

- Use this more advanced option, if you want to pair with an Ambianic Edge device - that you don't have physical access to - and you are not able to join its local network for an initial - pairing sequence. You need to request the device Peer ID - from someone who is already connected to it. Once you obtain - the Peer ID of the remote Ambiannic Edge device, enter it - below and click Pair Remotely. -

- - (Enter the Peer ID of the remote Ambianic Edge device.) - - -
- - - - Pair Remotely - - -
-
-
@@ -316,7 +250,7 @@ export default { syncing: false, // is the UI in the process of syncing with remote device data rules: { required: value => !!value || 'Required.', - counter: value => (value.length >= 5 && value.length <= 20) || 'Min 5 and Max 20 characters' + validPeerID: value => this.validatePeerID(value) || 'Must be a valid peer ID.' }, addDeviceStep: 1, // the sequential step number in the add device stepper flow isChoiceDiscoverLocal: false, // user chooses to discover a local device vs remote connection @@ -330,36 +264,45 @@ export default { methods: { // Validate the user input so the ID has the correct format before showing the connect button validatePeerID (value) { - if (/^([a-zA-Z0-9]{8})-([a-zA-Z0-9]{4})-([a-zA-Z0-9]{4})-([a-zA-Z0-9]{4})-([a-zA-Z0-9]{12})$/.test(value)) { + if (value && /^([a-zA-Z0-9]{8})-([a-zA-Z0-9]{4})-([a-zA-Z0-9]{4})-([a-zA-Z0-9]{4})-([a-zA-Z0-9]{12})$/.test(value)) { this.isPeerIdValid = true - return this.isPeerIdValid } else { - // if value is not matching regex, remove button + // if value is not matching regex, hide Connect button this.isPeerIdValid = false - return this.isPeerIdValid } + console.debug('isPeerIdValid (value)', { value }, this.isPeerIdValid) + return this.isPeerIdValid }, ...mapActions([ 'CHANGE_REMOTE_PEER_ID' ]), /** - * User clicked Connect to a selected device + * User clicked Connect to a discovered local device */ - async clickConnect () { - console.debug('clickConnect() enter') + async clickConnectToDiscoveredDevice () { + console.debug('clickConnectToDiscoveredDevice() called') this.addDeviceStep++ this.edgePeerId = this.discoveredPeers[this.selectedLocalDevice] console.debug('User selected device:', this.selectedLocalDevice, this.edgePeerId) - this.sendRemotePeerId() + await this.deviceConnect() + }, + /** + * User clicked Connect to a remote device + */ + async clickConnectToRemoteDevice () { + console.debug('clickConnectToRemoteDevice() called') + this.addDeviceStep++ + console.debug('User requested remote connection to device ID:', this.edgePeerId) + await this.deviceConnect() }, - async sendRemotePeerId () { + async deviceConnect () { await this.$store.dispatch(CHANGE_REMOTE_PEER_ID, this.edgePeerId) }, /** * User wants local device discovery */ async chooseDiscoverLocal () { - console.debug('chooseDiscoverLocal() enter') + console.debug('chooseDiscoverLocal() called') this.addDeviceStep++ this.isChoiceDiscoverLocal = true this.discoverLocalEdgeDevice() @@ -373,10 +316,18 @@ export default { console.debug('discoverLocalEdgeDevice() ended') }, /** - * User wants local device discovery + * User wants to connect to a remote device + */ + async chooseRemoteConnection () { + console.debug('chooseDiscoverLocal() called') + this.addDeviceStep++ + this.isChoiceDiscoverLocal = false + }, + /** + * Connection step completed. */ async connectStepCompleted () { - console.debug('connectStepCompleted() enter') + console.debug('connectStepCompleted() called') this.addDeviceStep++ } }, @@ -413,7 +364,7 @@ export default { }, watch: { edgePeerId (value) { - this.edgePeerId = value + // this.edgePeerId = value this.validatePeerID(value) }, isEdgeConnected: async function (isConnected) { From ce3c46e20436f31bbdd3c1e6dd7a831bdbaf8acc Mon Sep 17 00:00:00 2001 From: ivelin Date: Wed, 20 Oct 2021 22:38:03 +0000 Subject: [PATCH 14/47] chore: checkpoint Signed-off-by: ivelin --- src/components/shared/ListItem.vue | 309 +++++++++++++++-------------- src/views/Settings.vue | 84 ++++---- 2 files changed, 204 insertions(+), 189 deletions(-) diff --git a/src/components/shared/ListItem.vue b/src/components/shared/ListItem.vue index 79e84376..c2570258 100644 --- a/src/components/shared/ListItem.vue +++ b/src/components/shared/ListItem.vue @@ -1,163 +1,164 @@ + + diff --git a/src/store/edge-device.js b/src/store/edge-device.js index 81db6e56..80d59136 100644 --- a/src/store/edge-device.js +++ b/src/store/edge-device.js @@ -27,9 +27,7 @@ const mutations = { } -const edgeDevice = { +export const edgeDevice = { state, mutations } - -export default edgeDevice diff --git a/src/store/index.js b/src/store/index.js index 4d3aa361..11330597 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,8 +1,8 @@ import Vue from 'vue' import Vuex from 'vuex' -import { pnpStoreModule } from './pnp.js' -import edgeDevice from './edge-device' -// import { INITIALIZE_PNP } from './action-types.js' +import { pnpStoreModule } from './pnp' +import { edgeDevice } from './edge-device' +import { myDevices } from './mydevices' import { UPDATE_AVAILABLE } from './mutation-types' import snackBarModule from '@/store/status-snackbar' @@ -23,17 +23,9 @@ const store = new Vuex.Store({ modules: { pnp: pnpStoreModule, edgeDevice: edgeDevice, + myDevices: myDevices, snackBar: snackBarModule } }) -/** - * - * UPDATE (Aug 2021): turning off auto-init due to Lighthouse performance issues for PWA home screen. - * - * Begin connection attempt to Ambianic Edge as soon as the app is created. - - store.dispatch(INITIALIZE_PNP) -*/ - export default store diff --git a/src/store/localdb.js b/src/store/localdb.js index b074a298..1eb4607d 100644 --- a/src/store/localdb.js +++ b/src/store/localdb.js @@ -3,81 +3,20 @@ import Dexie from 'dexie' /** * LocalDatabase API for browser indexeddb objects */ -export class LocalDatabase extends Dexie { - constructor() { - // run the super constructor Dexie(databaseName) to create the IndexedDB - // database. - super('ambianic-database') +export const localdb = new Dexie('ambianic-database') - // create the todos store by passing an object into the stores method. We - // declare which object fields we want to index using a comma-separated - // string; the ++ for the index on the id field indicates that "id" is an - // auto-incrementing primary key, while the "done" field is just a regukar - // IndexedDB index. - this.version(1).stores({ - // mydevices keeps information about user's list of managed edge devices - mydevices: '++id, peerid', - }) +localdb.version(1).stores({ + // mydevices keeps information about user's list of managed edge devices + // peerid is the primary key using each device's unique peerid + // displayName is an index that makes sorting by displayName efficient + myDevices: 'peerid, displayName' +}) - // we can retrieve our todos store with Dexie.table, and then use it as a - // field on our Database class for convenience - this.mydevices = this.table('mydevices') - } - - // getTodos retrieves all todos from the todos object store in a defined - // order; order can be: - // - forwardOrder to get the todos in forward chronological order - // - reverseOrder to get the todos in reverse chronological order - // - unfinishedFirstOrder to get the todos in reverse chronological order - async getTodos(order) { - // In Dexie, we create queries by chaining methods, such as orderBy to - // sort by an indexed field, and reverse to reverse the order we retrieve - // data in. The toArray method returns a promise that resolves to the array - // of the items in the todos store. - let todos = []; - switch (order) { - case forwardOrder: - todos = await this.todos.orderBy('id').toArray(); - break; - case reverseOrder: - todos = await this.todos.orderBy('id').reverse().toArray(); - break; - case unfinishedFirstOrder: - todos = await this.todos.orderBy('done').toArray(); - break; - default: - // as a default just fall back to forward order - todos = await this.todos.orderBy('id').toArray(); - } - - // The reason we need to modify the done field on each todo is because in - // IndexedDB, integers can be indexed, but booleans cannot, so we represent - // "done" status as an integer. Only the database logic needs to know that - // detail, though, so for convenience when we return the todos, their "done" - // status is a boolean. - return todos.map((t) => { - t.done = !!t.done; - return t; - }); - } - - // setTodoDone sets whether or not the todo with the ID passed in is done. - // Returns a promise that resolves if the update is successful. - setTodoDone(id, done) { - return this.todos.update(id, { done: done ? 1 : 0 }) - } - - // addTodo adds a todo with the text passed in to the todos object store. - // Returns a promise that resolves if the addition is successful. - addTodo(text) { - // add a todo by passing in an object using Table.add. - return this.todos.add({ text: text, done: 0 }) - } - - // deleteTodo deletes a todo with the ID passed in from the todos object - // store. Returns a promise that resolves if the deletion is successful. - deleteTodo(todoID) { - // delete a todo by passing in the ID of that todo. - return this.todos.delete(todoID); - } -} +/** + * Edge device card properties + */ +export var EdgeDeviceCard = localdb.myDevices.defineClass({ + peerID: String, + displayName: String, + version: String +}) diff --git a/src/store/mydevices.js b/src/store/mydevices.js index e7d53e21..57a45b62 100644 --- a/src/store/mydevices.js +++ b/src/store/mydevices.js @@ -2,94 +2,55 @@ * API to manage a database of user's known Ambianic Edge devices. */ -import { LocalDatabase } from './localdb' -import { EDGE_DEVICE_DETAILS, EDGE_DEVICE_DISPLAY_NAME } from './mutation-types' - -/** - * Edge device card properties - */ -class EdgeDeviceCard { - peerID - displayName - version -} - -/** - * API for convenient access to mydevices data stored in - * browser local indexeddb. - */ -class MyDevicesDAO { - constructor() { - this.mydevicesTable = new LocalDatabase().mydevices - } -} +import { localdb } from './localdb' const state = { - // data access object pattern - dao: new MyDevicesDAO(), -} - -const mutations = { - [EDGE_DEVICE_DETAILS] (state, edgeDetails) { - if (edgeDetails) { - if (edgeDetails.version) { - state.edgeSoftwareVersion = edgeDetails.version - } - if (edgeDetails.display_name) { - state.edgeDisplayName = edgeDetails.display_name - } - } - }, - [EDGE_DEVICE_DISPLAY_NAME] (state, newDisplayName) { - if (newDisplayName) { - console.debug(`committing EDGE_DEVICE_DISPLAY_NAME: ${newDisplayName}`) - state.edgeDisplayName = newDisplayName - } else { - throw new Error('Device Display Name cannot have an empty value') - } - } - } -const getters = { +const actions = { /** - * - * Return a list with information about all of user's managed edge devices. - * @returns a list of EdgeDeviceCard objects + * Add to db info about a new device */ - getAll (state, getters) { - state.dao.getAll().then((list) => list) + async add (context, deviceCard) { + return await this.myDevices.add(deviceCard) }, /** - * Add to db info about a new device + * Update device properties */ - add (state, getters) { - // ... + async update (context, deviceCard) { + await this.myDevices.update(deviceCard.peerID, deviceCard) }, /** - * Get detailed info about a device by its peerID + * Forget information about a device given its peerID */ - get (state, getters, peerID) { - // ... - }, + async forget (context, peerID) { + await this.myDevices.delete(peerID) + } +} + +const getters = { /** - * Update device properties + * + * @returns an array of all stored EdgeDeviceCard objects */ - update (state, getters, deviceCard) { - // ... + getAll (context) { + localdb.myDevices.orderBy('displayName').toArray() + .then((deviceCards) => deviceCards) }, /** - * Forget information about a device given its peerID + * + * @returns the EdgeDeviceCard objects given a peerID. + * Or it returns null if there is no record found. */ - forget (state, getters, peerID) { - // ... - }, + get (context, peerID) { + localdb.myDevices.get(peerID) + .then((deviceCard) => deviceCard) + } } -const myDevices = { +export const myDevices = { + namespaced: true, state, - mutations, + actions, getters } - -export default myDevices diff --git a/src/views/DeviceCard.vue b/src/views/DeviceCard.vue index d06d7f66..61149c52 100644 --- a/src/views/DeviceCard.vue +++ b/src/views/DeviceCard.vue @@ -103,20 +103,17 @@ Connect - - Timeline diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 7f0f6953..237bae84 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -96,140 +96,44 @@ alt_route - - - -

No other devices added.

-
- -

- My Devices: -

-

...

-
- - - - mdi-plus - - - - - - Close - - -
+ +
+ +
- - - - Add Device - - - - Proceed to adding a new device connection? - - - - - - - Continue - - - - Cancel - - - - - - - My devices - - - Add and manage one or more Ambianic Edge devices. - - - - Add Device - - - + - - From d0752bf7ae5969436bc1b0bfd081e587c34ef96e Mon Sep 17 00:00:00 2001 From: ivelin Date: Sat, 23 Oct 2021 00:02:14 +0000 Subject: [PATCH 17/47] chore: checkpoint Signed-off-by: ivelin --- package-lock.json | 6 ++-- src/components/MyDevices.vue | 67 +++++++++++++++++++++++++---------- src/store/action-types.js | 2 +- src/store/index.js | 8 ++--- src/store/localdb.js | 2 +- src/store/mydevices.js | 43 ++++++++++++----------- src/views/AddDevice.vue | 68 +++++++++++++++++++----------------- src/views/DeviceCard.vue | 3 +- src/views/Settings.vue | 3 +- 9 files changed, 117 insertions(+), 85 deletions(-) diff --git a/package-lock.json b/package-lock.json index 738d0d10..6c3c8b04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10164,9 +10164,9 @@ }, "dependencies": { "@types/node": { - "version": "14.17.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.28.tgz", - "integrity": "sha512-1Nh2wEWN8y9hyC4yTDPccUnRunqNeBEFmmTU+K5FpGZOEixqAzMhUXzrBwajNYCZq5uoGaztaMN9Yy1PDMMB6Q==", + "version": "14.17.29", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.29.tgz", + "integrity": "sha512-sd4CHI9eTJXTH2vF3RGtGkqvWRwhsSSUFsXD4oG38GZzSZ0tNPbWikd2AbOAcKxCXhOg57fL8FPxjpfSzb2pIQ==", "dev": true }, "bluebird": { diff --git a/src/components/MyDevices.vue b/src/components/MyDevices.vue index 0fbd8402..964f514a 100644 --- a/src/components/MyDevices.vue +++ b/src/components/MyDevices.vue @@ -6,23 +6,39 @@ width="344" > - My Devices + My Devices: -

No devices added.

+

No device added.

-

- My Devices: -

-

...

+ + + + +
@@ -39,7 +55,14 @@ - + + + Switch Device + alt_route + ', this.allDeviceCards) }, mounted () { }, methods: { - ...mapActions([ - 'CHANGE_REMOTE_PEER_ID' - ]), - async selectAnotherEdgeDevice () { - await this.$store.dispatch(CHANGE_REMOTE_PEER_ID, this.edgeAddress) + ...mapActions({ + switchEdgeDevice: CHANGE_REMOTE_PEER_ID, + loadAllCards: 'myDevices/loadAll' + }), + async switchDevice () { + await this.switchEdgeDevice(this.selectedDeviceID) + }, + pickDevice ({ id }) { + this.selectedDeviceID = id } }, computed: { + isSelectedDeviceCurrent: function (state) { return (this.selectedDeviceID === state.pnp.remotePeerId) }, ...mapState({ - pnp: state => state.pnp, - all: state => state.myDevices.getAll, - myDevices: state => state.myDevices + allDeviceCards: state => state.myDevices.allDeviceCards, + currentDevicePeerId: state => state.pnp.remotePeerId, + pnp: state => state.pnp }) } } diff --git a/src/store/action-types.js b/src/store/action-types.js index 1be6c4f7..8e3f76ff 100644 --- a/src/store/action-types.js +++ b/src/store/action-types.js @@ -9,5 +9,5 @@ export const PEER_DISCOVER = 'peerDiscover' export const PEER_CONNECT = 'peerConnect' export const PEER_AUTHENTICATE = 'peerAuthenticate' export const REMOVE_REMOTE_PEER_ID = 'removeRemotePeerId' -export const CHANGE_REMOTE_PEER_ID = 'newRemotePeerId' +export const CHANGE_REMOTE_PEER_ID = 'changeRemotePeerId' export const HANDLE_PEER_CONNECTION_ERROR = 'handlePeerConnectionError' diff --git a/src/store/index.js b/src/store/index.js index 11330597..07faf8f6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,9 +1,9 @@ import Vue from 'vue' import Vuex from 'vuex' -import { pnpStoreModule } from './pnp' -import { edgeDevice } from './edge-device' -import { myDevices } from './mydevices' -import { UPDATE_AVAILABLE } from './mutation-types' +import { pnpStoreModule } from '@/store/pnp' +import { edgeDevice } from '@/store/edge-device' +import { myDevices } from '@/store/mydevices' +import { UPDATE_AVAILABLE } from '@/store/mutation-types' import snackBarModule from '@/store/status-snackbar' Vue.use(Vuex) diff --git a/src/store/localdb.js b/src/store/localdb.js index 1eb4607d..ac90dace 100644 --- a/src/store/localdb.js +++ b/src/store/localdb.js @@ -9,7 +9,7 @@ localdb.version(1).stores({ // mydevices keeps information about user's list of managed edge devices // peerid is the primary key using each device's unique peerid // displayName is an index that makes sorting by displayName efficient - myDevices: 'peerid, displayName' + myDevices: '&peerID, displayName' }) /** diff --git a/src/store/mydevices.js b/src/store/mydevices.js index 57a45b62..64f089f9 100644 --- a/src/store/mydevices.js +++ b/src/store/mydevices.js @@ -5,6 +5,8 @@ import { localdb } from './localdb' const state = { + // list of all user's device cards + allDeviceCards: {} } const actions = { @@ -12,45 +14,44 @@ const actions = { * Add to db info about a new device */ async add (context, deviceCard) { - return await this.myDevices.add(deviceCard) + console.debug('add() called', { deviceCard }) + const recordId = await localdb.myDevices.add(deviceCard) + console.debug('add() success.', { deviceCard, recordId }) + return recordId }, /** * Update device properties */ async update (context, deviceCard) { - await this.myDevices.update(deviceCard.peerID, deviceCard) + await localdb.myDevices.update(deviceCard.peerID, deviceCard) }, /** * Forget information about a device given its peerID */ async forget (context, peerID) { - await this.myDevices.delete(peerID) - } -} - -const getters = { - /** - * - * @returns an array of all stored EdgeDeviceCard objects - */ - getAll (context) { - localdb.myDevices.orderBy('displayName').toArray() - .then((deviceCards) => deviceCards) + await localdb.myDevices.delete(peerID) }, /** * - * @returns the EdgeDeviceCard objects given a peerID. - * Or it returns null if there is no record found. + * Load all stored EdgeDeviceCard objects into local state object */ - get (context, peerID) { - localdb.myDevices.get(peerID) - .then((deviceCard) => deviceCard) + async loadAll ({ state }) { + const deviceCardArray = await localdb.myDevices.orderBy('displayName').toArray() + // convery array to a hashmap + const deviceCardMap = deviceCardArray.reduce( + function (map, deviceCard) { + map[deviceCard.peerID] = deviceCard + return map + }, + {} + ) + console.debug('getAll() -> ', { deviceCardArray, deviceCardMap }) + state.allDeviceCards = deviceCardMap } } export const myDevices = { namespaced: true, state, - actions, - getters + actions } diff --git a/src/views/AddDevice.vue b/src/views/AddDevice.vue index e2de7be9..03e00fd4 100644 --- a/src/views/AddDevice.vue +++ b/src/views/AddDevice.vue @@ -223,20 +223,17 @@ diff --git a/src/views/Settings.vue b/src/views/Settings.vue index 020b2ca5..d13b685b 100644 --- a/src/views/Settings.vue +++ b/src/views/Settings.vue @@ -25,20 +25,37 @@ - + {{ edgeDisplayName }} + + No device selected. + My current device - + + Select a device to connect to. + + @@ -89,28 +106,14 @@ - Select Another Device - alt_route + Select Device + list - -
- -
-
- - - @@ -118,18 +121,19 @@ import { mapState } from 'vuex' import { PEER_CONNECTED, - PEER_CONNECTION_ERROR + PEER_CONNECTION_ERROR, + PEER_CONNECTING, + PEER_DISCONNECTING, + PEER_AUTHENTICATING } from '@/store/mutation-types' export default { components: { AmbAppFrame: () => import('@/components/AppFrame.vue'), - AmbListItem: () => import('@/components/shared/ListItem.vue'), - MyDevices: () => import('@/components/MyDevices.vue') + AmbListItem: () => import('@/components/shared/ListItem.vue') }, data () { return { - reveal: false, edgeAddress: undefined, edgeDeviceError: null, syncing: false // is the UI in the process of syncing with remote device data @@ -150,7 +154,12 @@ export default { pnp: state => state.pnp, edgePeerId: state => state.pnp.remotePeerId, peerFetch: state => state.pnp.peerFetch, - edgeDisplayName: state => state.edgeDevice.edgeDisplayName + edgeDisplayName: state => state.edgeDevice.edgeDisplayName, + isEdgeConnecting: state => + state.pnp.peerConnectionStatus === PEER_CONNECTING || + state.pnp.peerConnectionStatus === PEER_AUTHENTICATING, + isEdgeDisconnecting: state => + state.pnp.peerConnectionStatus === PEER_DISCONNECTING }) }, watch: { From 9f33672e4cd8ab33d8d2f50f5a0f4d4307939929 Mon Sep 17 00:00:00 2001 From: ivelin Date: Mon, 25 Oct 2021 20:06:27 +0000 Subject: [PATCH 19/47] chore: checkpoint Signed-off-by: ivelin --- package-lock.json | 20 +++++++++---------- src/components/MyDevices.vue | 37 +++++++++++++++--------------------- src/store/mydevices.js | 13 +++++++++---- src/store/pnp.js | 4 ++-- src/views/AddDevice.vue | 28 ++++++++++++++++++++------- src/views/DeviceCard.vue | 1 - src/views/Settings.vue | 23 +++++++++++----------- 7 files changed, 68 insertions(+), 58 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c3c8b04..ce97fabe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10164,9 +10164,9 @@ }, "dependencies": { "@types/node": { - "version": "14.17.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.29.tgz", - "integrity": "sha512-sd4CHI9eTJXTH2vF3RGtGkqvWRwhsSSUFsXD4oG38GZzSZ0tNPbWikd2AbOAcKxCXhOg57fL8FPxjpfSzb2pIQ==", + "version": "14.17.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.31.tgz", + "integrity": "sha512-MUeD1RfIycvO6Msfdl4vzfce7r0FWimF8QFdY1XslfHMFYmUvcZDPkaYrqdVLOi9pugnO4ASHyThb2K4hbjxMA==", "dev": true }, "bluebird": { @@ -18099,13 +18099,13 @@ "dev": true }, "listr2": { - "version": "3.12.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.12.2.tgz", - "integrity": "sha512-64xC2CJ/As/xgVI3wbhlPWVPx0wfTqbUAkpb7bjDi0thSWMqrf07UFhrfsGoo8YSXmF049Rp9C0cjLC8rZxK9A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.13.1.tgz", + "integrity": "sha512-pk4YBDA2cxtpM8iLHbz6oEsfZieJKHf6Pt19NlKaHZZVpqHyVs/Wqr7RfBBCeAFCJchGO7WQHVkUPZTvJMHk8w==", "dev": true, "requires": { "cli-truncate": "^2.1.0", - "colorette": "^1.4.0", + "colorette": "^2.0.16", "log-update": "^4.0.0", "p-map": "^4.0.0", "rxjs": "^6.6.7", @@ -18114,9 +18114,9 @@ }, "dependencies": { "colorette": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", - "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", + "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", "dev": true }, "emoji-regex": { diff --git a/src/components/MyDevices.vue b/src/components/MyDevices.vue index 8474b232..b38303f7 100644 --- a/src/components/MyDevices.vue +++ b/src/components/MyDevices.vue @@ -11,9 +11,9 @@ -

No device added.

+

No devices added.

diff --git a/src/components/MyDevices.vue b/src/components/MyDevices.vue index b38303f7..79a1f593 100644 --- a/src/components/MyDevices.vue +++ b/src/components/MyDevices.vue @@ -112,15 +112,13 @@ export default { }, created () { }, - async mounted () { - await this.loadAllCards() + mounted () { this.newSelectedDeviceID = this.currentDevicePeerId }, methods: { ...mapActions({ switchEdgeDeviceConnection: CHANGE_REMOTE_PEER_ID, - loadAllCards: 'myDevices/loadAll', - setCurrentDevice: 'edgeDevice/setCurrent' + setCurrentDevice: 'myDevices/setCurrent' }), async switchDevice () { // update current device card details from local db diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 7366a4aa..b00a7b4d 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -155,7 +155,6 @@ diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index b00a7b4d..8aa12943 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -6,63 +6,73 @@ > - - - Ambianic - + + + + {{ $route.meta.title }} + + - + + + Event Timeline + -
- - + {{ connectionStatusTooltipText }} + - - + + Settings + @@ -74,7 +84,7 @@ expand-on-hover > -