From 1a7164330deb9a54a4bc214c5e3b1377b95af67c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Jun 2018 18:30:14 +0200 Subject: [PATCH 01/99] chore: Update autoprefixer to version 8.6.3 (#3705) --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 615360df2f9..f84a3536f69 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "uuid": "3.2.1" }, "devDependencies": { - "autoprefixer": "8.6.2", + "autoprefixer": "8.6.3", "babel-core": "6.26.3", "babel-eslint": "8.2.3", "babel-loader": "7.1.4", diff --git a/yarn.lock b/yarn.lock index 7706d971f1c..e7191a3cc06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -990,12 +990,12 @@ atob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" -autoprefixer@8.6.2, autoprefixer@^8.0.0: - version "8.6.2" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-8.6.2.tgz#51d42ff13243820a582a53ecca20dedaeb7f2efd" +autoprefixer@8.6.3, autoprefixer@^8.0.0: + version "8.6.3" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-8.6.3.tgz#1d38a129e6a4582a565b6570d16f2d7d3de9cbf9" dependencies: browserslist "^3.2.8" - caniuse-lite "^1.0.30000851" + caniuse-lite "^1.0.30000856" normalize-range "^0.1.2" num2fraction "^1.2.2" postcss "^6.0.22" @@ -2136,9 +2136,9 @@ caniuse-lite@^1.0.30000844: version "1.0.30000846" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000846.tgz#2092911eecad71a89dae1faa62bcc202fde7f959" -caniuse-lite@^1.0.30000851: - version "1.0.30000851" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000851.tgz#3b498aebf9f92cf6cff4ab54d13b557c0b590533" +caniuse-lite@^1.0.30000856: + version "1.0.30000856" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000856.tgz#ecc16978135a6f219b138991eb62009d25ee8daa" caseless@~0.11.0: version "0.11.0" From 69f137f0070169c6b4247f84ac8820705e04b019 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Jun 2018 18:35:15 +0200 Subject: [PATCH 02/99] chore: Update @wireapp/react-ui-kit to version 1.1.42 (#3706) --- package.json | 2 +- yarn.lock | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f84a3536f69..1eb7097a226 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.1.3", - "@wireapp/react-ui-kit": "1.1.41", + "@wireapp/react-ui-kit": "1.1.42", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index e7191a3cc06..41c71866de1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,11 +571,11 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.1.41": - version "1.1.41" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.41.tgz#335360b106220232a066de88938bea3f1bbb160b" +"@wireapp/react-ui-kit@1.1.42": + version "1.1.42" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.42.tgz#1f5eae7f64b1ca6b8b21d32a5a6c021356fefaed" dependencies: - bazinga64 "5.2.3" + bazinga64 "5.2.4" color "3.0.0" react "16.4.1" react-dom "16.4.1" @@ -1702,6 +1702,10 @@ bazinga64@5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.3.tgz#9715b753a76fcc0d004fdd20c504a7925f4a63b1" +bazinga64@5.2.4: + version "5.2.4" + resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.4.tgz#45b0403cdfaa3bf9406ff3eee596db59b4c1c9e3" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" From e3beb4fe549f5cdb37e8c019f5193f5f4850ff80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 18 Jun 2018 18:47:41 +0200 Subject: [PATCH 03/99] chore: Update @wireapp/core to version 3.2.1 (#3710) --- package.json | 2 +- yarn.lock | 74 +++++++++++++++++++++++++--------------------------- 2 files changed, 36 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 1eb7097a226..a742b6e245c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.1.3", + "@wireapp/core": "3.2.1", "@wireapp/react-ui-kit": "1.1.42", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 41c71866de1..ff64876d945 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,15 +503,15 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.1.10": - version "1.1.10" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.10.tgz#42ef80d2de9cc23065885cd5b8bfab71e3a37d19" +"@wireapp/api-client@1.1.12": + version "1.1.12" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.12.tgz#adf499eabc09055ca201cdb66212497652e28198" dependencies: "@types/node" "10.3.3" "@types/spark-md5" "3.0.0" "@types/tough-cookie" "2.3.3" - "@wireapp/priority-queue" "0.1.45" - "@wireapp/store-engine" "0.11.29" + "@wireapp/priority-queue" "0.1.46" + "@wireapp/store-engine" "0.11.31" axios "0.18.0" html5-websocket "2.0.3" logdown "3.2.3" @@ -519,55 +519,55 @@ spark-md5 "3.0.0" tough-cookie "2.4.2" -"@wireapp/cbor@3.0.48": - version "3.0.48" - resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.48.tgz#8037dfdeb3666fbeff00d151a8a3d12b25eef678" +"@wireapp/cbor@3.0.49": + version "3.0.49" + resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.49.tgz#4f30a947a7acf422f911e6c642b5c7d6cb56c87c" -"@wireapp/core@3.1.3": - version "3.1.3" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.1.3.tgz#8d066246c349628e074f7c99cdfa3ff7ae730ad8" +"@wireapp/core@3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.2.1.tgz#af561c317969715cea46f0ddf116dfd6e28a788c" dependencies: "@types/node" "10.3.3" - "@wireapp/api-client" "1.1.10" - "@wireapp/cryptobox" "8.4.5" - "@wireapp/store-engine" "0.11.29" - bazinga64 "5.2.3" + "@wireapp/api-client" "1.1.12" + "@wireapp/cryptobox" "8.4.7" + "@wireapp/store-engine" "0.11.31" + bazinga64 "5.2.4" logdown "3.2.3" protobufjs "6.8.6" pure-uuid "1.5.2" -"@wireapp/cryptobox@8.4.5": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.4.5.tgz#f43a6cec68de239627600dc175884f7aea961506" +"@wireapp/cryptobox@8.4.7": + version "8.4.7" + resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.4.7.tgz#496b8ea6cd777efbce96d7879d71911b87d82157" dependencies: "@types/fs-extra" "5.0.3" "@types/node" "10.3.3" - "@wireapp/lru-cache" "2.1.27" - "@wireapp/priority-queue" "0.1.45" - "@wireapp/proteus" "7.1.61" - "@wireapp/store-engine" "0.11.29" + "@wireapp/lru-cache" "2.1.28" + "@wireapp/priority-queue" "0.1.46" + "@wireapp/proteus" "7.1.62" + "@wireapp/store-engine" "0.11.31" dexie "2.0.4" fs-extra "6.0.1" -"@wireapp/lru-cache@2.1.27": - version "2.1.27" - resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.27.tgz#ab637e9394a38463d7ea26aa7b2144a1fd614a38" +"@wireapp/lru-cache@2.1.28": + version "2.1.28" + resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.28.tgz#6cb7aea2b9f972c19194961eebdaea97df577da1" -"@wireapp/priority-queue@0.1.45": - version "0.1.45" - resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.45.tgz#8b8697268b9a7ee6bc604aa772e813231d194f27" +"@wireapp/priority-queue@0.1.46": + version "0.1.46" + resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.46.tgz#8d554dc7d48e65e2ef1a923d9017842663f469ab" dependencies: "@types/node" "10.3.3" pure-uuid "1.5.2" -"@wireapp/proteus@7.1.61": - version "7.1.61" - resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.1.61.tgz#1b6b43c6835a4798c6826b3106f78acac4c63a05" +"@wireapp/proteus@7.1.62": + version "7.1.62" + resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.1.62.tgz#1b88d89e5eddff60b66b2b971b363025e2ce5807" dependencies: "@types/chai" "4.1.4" "@types/ed2curve" "0.2.2" "@types/node" "10.3.3" - "@wireapp/cbor" "3.0.48" + "@wireapp/cbor" "3.0.49" ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" @@ -583,9 +583,9 @@ styled-components "3.3.2" styled-normalize "4.0.0" -"@wireapp/store-engine@0.11.29": - version "0.11.29" - resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.29.tgz#662a6dab969fa9c3d69b9e0af0b481b481bfa847" +"@wireapp/store-engine@0.11.31": + version "0.11.31" + resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.31.tgz#e4afcd223c14f090f4de936ec86eabe428b097d1" dependencies: "@types/filesystem" "0.0.28" "@types/node" "10.3.3" @@ -1698,10 +1698,6 @@ batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" -bazinga64@5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.3.tgz#9715b753a76fcc0d004fdd20c504a7925f4a63b1" - bazinga64@5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.4.tgz#45b0403cdfaa3bf9406ff3eee596db59b4c1c9e3" From 2f476f9f86fc73ea61407a3cf51df2347b50ae76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 11:12:01 +0200 Subject: [PATCH 04/99] chore: Update @wireapp/core to version 3.2.2 (#3712) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a742b6e245c..5c3bbd439f6 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.2.1", + "@wireapp/core": "3.2.2", "@wireapp/react-ui-kit": "1.1.42", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index ff64876d945..5e3fd4d3b60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -523,9 +523,9 @@ version "3.0.49" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.49.tgz#4f30a947a7acf422f911e6c642b5c7d6cb56c87c" -"@wireapp/core@3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.2.1.tgz#af561c317969715cea46f0ddf116dfd6e28a788c" +"@wireapp/core@3.2.2": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.2.2.tgz#be3f578c9a2509eaed46988af3415135cf19b625" dependencies: "@types/node" "10.3.3" "@wireapp/api-client" "1.1.12" From fc91c19ab298ecf9f309e55cf1d5e6681b2c5ce7 Mon Sep 17 00:00:00 2001 From: Michael Koppen Date: Tue, 19 Jun 2018 11:13:13 +0200 Subject: [PATCH 05/99] fix: Align cookie policy close button (#3638) --- app/script/auth/component/WirelessContainer.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/script/auth/component/WirelessContainer.jsx b/app/script/auth/component/WirelessContainer.jsx index 7bdeb9f6727..d645ff6584c 100644 --- a/app/script/auth/component/WirelessContainer.jsx +++ b/app/script/auth/component/WirelessContainer.jsx @@ -46,7 +46,7 @@ export const WirelessContainer = ({ margin: '0', }} > -
+
From 0013689829368d3b756642da8dc963f1f9a5c20d Mon Sep 17 00:00:00 2001 From: Michael Koppen Date: Tue, 19 Jun 2018 11:13:33 +0200 Subject: [PATCH 06/99] fix: Fullscreen app opened modal for PWA supported browsers (#3632) --- app/script/auth/component/AppAlreadyOpen.jsx | 8 ++++++-- app/script/auth/page/ConversationJoin.jsx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/script/auth/component/AppAlreadyOpen.jsx b/app/script/auth/component/AppAlreadyOpen.jsx index 47e69b8fd23..c29e4e922a0 100644 --- a/app/script/auth/component/AppAlreadyOpen.jsx +++ b/app/script/auth/component/AppAlreadyOpen.jsx @@ -32,10 +32,14 @@ class AppAlreadyOpen extends React.Component { }; render = () => { - const {isAppAlreadyOpen, intl: {formatMessage: _}} = this.props; + const { + isAppAlreadyOpen, + fullscreen, + intl: {formatMessage: _}, + } = this.props; return ( isAppAlreadyOpen && ( - +

{_(appAlreadyOpenStrings.headline)} diff --git a/app/script/auth/page/ConversationJoin.jsx b/app/script/auth/page/ConversationJoin.jsx index 2620cc0b56a..6a5b92df785 100644 --- a/app/script/auth/page/ConversationJoin.jsx +++ b/app/script/auth/page/ConversationJoin.jsx @@ -196,7 +196,7 @@ class ConversationJoin extends Component { const {error} = this.state; return ( - +

- +

From 04c4db6b2ebe5e72fff05b0a6f2a675905df39b6 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Tue, 19 Jun 2018 11:19:17 +0200 Subject: [PATCH 07/99] fix: Handle self user join in group call (#3713) --- app/script/calling/CallingRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/script/calling/CallingRepository.js b/app/script/calling/CallingRepository.js index 2ffa9f46727..5127ae0b1c2 100644 --- a/app/script/calling/CallingRepository.js +++ b/app/script/calling/CallingRepository.js @@ -376,7 +376,7 @@ z.calling.CallingRepository = class CallingRepository { const isSelfUser = userId === this.selfUserId(); if (isSelfUser) { - this._remoteSelfJoin(callEntity, callMessageEntity); + return this._remoteSelfJoin(callEntity, callMessageEntity); } if (callEntity.isOutgoing()) { From 761edbbafbf989ebcf696765f8d62ba5d6437eb1 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Tue, 19 Jun 2018 11:23:47 +0200 Subject: [PATCH 08/99] fix: Check media type before wrapping input stream (#3714) --- app/script/calling/entities/FlowEntity.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/script/calling/entities/FlowEntity.js b/app/script/calling/entities/FlowEntity.js index 1e6464a4a02..2c375887143 100644 --- a/app/script/calling/entities/FlowEntity.js +++ b/app/script/calling/entities/FlowEntity.js @@ -1289,8 +1289,9 @@ z.calling.entities.FlowEntity = class FlowEntity { */ _addMediaStream(mediaStream) { if (mediaStream) { - const isTypeAudio = mediaStream.type === z.media.MediaType.AUDIO; - if (isTypeAudio) { + const mediaType = z.media.MediaStreamHandler.detectMediaStreamType(mediaStream); + const containsAudio = z.media.MediaStreamHandler.CONFIG.CONTAINS_AUDIO.includes(mediaType); + if (containsAudio) { mediaStream = this.audio.wrapAudioInputStream(mediaStream); } From 307f20179adfaf97ed4da09ddfd9e00bb140be93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 12:00:03 +0200 Subject: [PATCH 09/99] chore: Update @wireapp/react-ui-kit to version 1.1.43 (#3716) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5c3bbd439f6..4de7e8d4c3f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.2.2", - "@wireapp/react-ui-kit": "1.1.42", + "@wireapp/react-ui-kit": "1.1.43", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index 5e3fd4d3b60..c1e8f80aaa7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,9 +571,9 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.1.42": - version "1.1.42" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.42.tgz#1f5eae7f64b1ca6b8b21d32a5a6c021356fefaed" +"@wireapp/react-ui-kit@1.1.43": + version "1.1.43" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.43.tgz#274864017340c76b32d90481a984c533685f9b82" dependencies: bazinga64 "5.2.4" color "3.0.0" From 8c46840e8865e277d119be4a484f954eb203a92c Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Tue, 19 Jun 2018 12:04:38 +0200 Subject: [PATCH 10/99] chore: Update Conversation ID for CS Bot (#3718) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d6ca3c11bee..af49641adeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,7 +120,7 @@ deploy: branch: prod after_deploy: - - wire-travis-bot "fa0daf62-d5dc-48d2-aa92-ad2e0adeff4c" + - wire-travis-bot "a720ce02-c44c-4981-936c-609380884231" - | if [ "${TRAVIS_BRANCH}" == "staging" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then wire-changelog-bot -e "${WIRE_WEBAPP_BOT_EMAIL}" -p "${WIRE_WEBAPP_BOT_PASSWORD}" -c "4ae15efc-d061-4013-98f2-bcd81ab39b60" From bf9dc01a0ba0ce4928d1e54213f138b8fe636f0a Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Tue, 19 Jun 2018 12:14:16 +0200 Subject: [PATCH 11/99] chore: Update Conversation ID for CS Bot (#3720) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index af49641adeb..80e5f1bee4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,8 +120,8 @@ deploy: branch: prod after_deploy: - - wire-travis-bot "a720ce02-c44c-4981-936c-609380884231" + - wire-travis-bot "fa0daf62-d5dc-48d2-aa92-ad2e0adeff4c" - | if [ "${TRAVIS_BRANCH}" == "staging" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then - wire-changelog-bot -e "${WIRE_WEBAPP_BOT_EMAIL}" -p "${WIRE_WEBAPP_BOT_PASSWORD}" -c "4ae15efc-d061-4013-98f2-bcd81ab39b60" + wire-changelog-bot -e "${WIRE_WEBAPP_BOT_EMAIL}" -p "${WIRE_WEBAPP_BOT_PASSWORD}" -c "a720ce02-c44c-4981-936c-609380884231" fi From bb5692e4a021b5517e63fc6c2b9a22e89bca8d2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 12:21:59 +0200 Subject: [PATCH 12/99] chore: Update @wireapp/core to version 3.2.3 (#3717) --- package.json | 2 +- yarn.lock | 78 ++++++++++++++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 4de7e8d4c3f..df19a9514a0 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.2.2", + "@wireapp/core": "3.2.3", "@wireapp/react-ui-kit": "1.1.43", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index c1e8f80aaa7..eba391b8cea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -343,9 +343,9 @@ version "10.1.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.2.tgz#1b928a0baa408fc8ae3ac012cc81375addc147c6" -"@types/node@10.3.3": - version "10.3.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.3.tgz#8798d9e39af2fa604f715ee6a6b19796528e46c3" +"@types/node@10.3.4": + version "10.3.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.4.tgz#c74e8aec19e555df44609b8057311052a2c84d9e" "@types/node@^6.0.46": version "6.0.90" @@ -503,15 +503,15 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.1.12": - version "1.1.12" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.12.tgz#adf499eabc09055ca201cdb66212497652e28198" +"@wireapp/api-client@1.1.13": + version "1.1.13" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.13.tgz#1676505a7edb103ddc02e8776111e6c5f46bdea0" dependencies: - "@types/node" "10.3.3" + "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" "@types/tough-cookie" "2.3.3" - "@wireapp/priority-queue" "0.1.46" - "@wireapp/store-engine" "0.11.31" + "@wireapp/priority-queue" "0.1.47" + "@wireapp/store-engine" "0.11.32" axios "0.18.0" html5-websocket "2.0.3" logdown "3.2.3" @@ -519,33 +519,33 @@ spark-md5 "3.0.0" tough-cookie "2.4.2" -"@wireapp/cbor@3.0.49": - version "3.0.49" - resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.49.tgz#4f30a947a7acf422f911e6c642b5c7d6cb56c87c" +"@wireapp/cbor@3.0.50": + version "3.0.50" + resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.2.2": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.2.2.tgz#be3f578c9a2509eaed46988af3415135cf19b625" +"@wireapp/core@3.2.3": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.2.3.tgz#d79e63b613af70c957ec7e60a0341223a1b432e5" dependencies: - "@types/node" "10.3.3" - "@wireapp/api-client" "1.1.12" - "@wireapp/cryptobox" "8.4.7" - "@wireapp/store-engine" "0.11.31" + "@types/node" "10.3.4" + "@wireapp/api-client" "1.1.13" + "@wireapp/cryptobox" "8.4.8" + "@wireapp/store-engine" "0.11.32" bazinga64 "5.2.4" logdown "3.2.3" protobufjs "6.8.6" pure-uuid "1.5.2" -"@wireapp/cryptobox@8.4.7": - version "8.4.7" - resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.4.7.tgz#496b8ea6cd777efbce96d7879d71911b87d82157" +"@wireapp/cryptobox@8.4.8": + version "8.4.8" + resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.4.8.tgz#e6c964c819264b91d88bc40eaa909b17ca130ebc" dependencies: "@types/fs-extra" "5.0.3" - "@types/node" "10.3.3" + "@types/node" "10.3.4" "@wireapp/lru-cache" "2.1.28" - "@wireapp/priority-queue" "0.1.46" - "@wireapp/proteus" "7.1.62" - "@wireapp/store-engine" "0.11.31" + "@wireapp/priority-queue" "0.1.47" + "@wireapp/proteus" "7.1.63" + "@wireapp/store-engine" "0.11.32" dexie "2.0.4" fs-extra "6.0.1" @@ -553,21 +553,21 @@ version "2.1.28" resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.28.tgz#6cb7aea2b9f972c19194961eebdaea97df577da1" -"@wireapp/priority-queue@0.1.46": - version "0.1.46" - resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.46.tgz#8d554dc7d48e65e2ef1a923d9017842663f469ab" +"@wireapp/priority-queue@0.1.47": + version "0.1.47" + resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.47.tgz#7dbe0c54f5fb669c1753163a3d3c06664e422d26" dependencies: - "@types/node" "10.3.3" + "@types/node" "10.3.4" pure-uuid "1.5.2" -"@wireapp/proteus@7.1.62": - version "7.1.62" - resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.1.62.tgz#1b88d89e5eddff60b66b2b971b363025e2ce5807" +"@wireapp/proteus@7.1.63": + version "7.1.63" + resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.1.63.tgz#0387c12deb8922a71aa390450412784858407ad5" dependencies: "@types/chai" "4.1.4" "@types/ed2curve" "0.2.2" - "@types/node" "10.3.3" - "@wireapp/cbor" "3.0.49" + "@types/node" "10.3.4" + "@wireapp/cbor" "3.0.50" ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" @@ -583,12 +583,12 @@ styled-components "3.3.2" styled-normalize "4.0.0" -"@wireapp/store-engine@0.11.31": - version "0.11.31" - resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.31.tgz#e4afcd223c14f090f4de936ec86eabe428b097d1" +"@wireapp/store-engine@0.11.32": + version "0.11.32" + resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.32.tgz#bdbc14130e6dd0da33aa7c16b61b502c3b4ac033" dependencies: "@types/filesystem" "0.0.28" - "@types/node" "10.3.3" + "@types/node" "10.3.4" bro-fs "0.4.0" dexie "2.0.4" fs-extra "6.0.1" From ceb6f3824092da86384b75e5749792e107a43f75 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Tue, 19 Jun 2018 13:32:32 +0200 Subject: [PATCH 13/99] fix: Check for expected media type --- app/script/calling/entities/FlowEntity.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/script/calling/entities/FlowEntity.js b/app/script/calling/entities/FlowEntity.js index 2c375887143..f39076021f3 100644 --- a/app/script/calling/entities/FlowEntity.js +++ b/app/script/calling/entities/FlowEntity.js @@ -1290,7 +1290,7 @@ z.calling.entities.FlowEntity = class FlowEntity { _addMediaStream(mediaStream) { if (mediaStream) { const mediaType = z.media.MediaStreamHandler.detectMediaStreamType(mediaStream); - const containsAudio = z.media.MediaStreamHandler.CONFIG.CONTAINS_AUDIO.includes(mediaType); + const containsAudio = z.media.MediaStreamHandler.CONFIG.MEDIA_TYPE.CONTAINS_AUDIO.includes(mediaType); if (containsAudio) { mediaStream = this.audio.wrapAudioInputStream(mediaStream); } From 4d26617d20b1d5523172a30b4663ece574487db3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 14:48:53 +0200 Subject: [PATCH 14/99] chore: Update concurrently to version 3.6.0 (#3724) --- package.json | 2 +- yarn.lock | 45 ++++++--------------------------------------- 2 files changed, 7 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index df19a9514a0..f6dfdd6dc4e 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "babel-plugin-transform-object-rest-spread": "6.26.0", "babel-preset-env": "1.7.0", "babel-preset-react": "6.24.1", - "concurrently": "3.5.1", + "concurrently": "3.6.0", "cssnano": "3.10.0", "enzyme": "3.3.0", "enzyme-adapter-react-16": "1.1.1", diff --git a/yarn.lock b/yarn.lock index eba391b8cea..80864b776dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -737,10 +737,6 @@ ansi-html@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" -ansi-regex@^0.2.0, ansi-regex@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -749,10 +745,6 @@ ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" -ansi-styles@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" - ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -2159,16 +2151,6 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" - dependencies: - ansi-styles "^1.1.0" - escape-string-regexp "^1.0.0" - has-ansi "^0.1.0" - strip-ansi "^0.3.0" - supports-color "^0.2.0" - chalk@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" @@ -2594,14 +2576,15 @@ concat-stream@^1.5.0, concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" -concurrently@3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.5.1.tgz#ee8b60018bbe86b02df13e5249453c6ececd2521" +concurrently@3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.6.0.tgz#c25e34b156a9d5bd4f256a0d85f6192438ae481f" dependencies: - chalk "0.5.1" + chalk "^2.4.1" commander "2.6.0" date-fns "^1.23.0" lodash "^4.5.1" + read-pkg "^3.0.0" rx "2.3.24" spawn-command "^0.0.2-1" supports-color "^3.2.3" @@ -3534,7 +3517,7 @@ escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" -escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -4750,12 +4733,6 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" -has-ansi@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" - dependencies: - ansi-regex "^0.2.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -9883,12 +9860,6 @@ stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" -strip-ansi@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" - dependencies: - ansi-regex "^0.2.1" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -10111,10 +10082,6 @@ sugarss@^1.0.0: dependencies: postcss "^6.0.14" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" From e4ad501ff0505959f5be0e6eeba1ff6c7d6f19cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 15:01:59 +0200 Subject: [PATCH 15/99] chore: Update @wireapp/core to version 3.3.0 (#3726) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f6dfdd6dc4e..a1b27de08e3 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.2.3", + "@wireapp/core": "3.3.0", "@wireapp/react-ui-kit": "1.1.43", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 80864b776dc..3c96284aa1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -523,9 +523,9 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.2.3": - version "3.2.3" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.2.3.tgz#d79e63b613af70c957ec7e60a0341223a1b432e5" +"@wireapp/core@3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.3.0.tgz#cb4869be4469554c45a65c985eaedeece60ac6bb" dependencies: "@types/node" "10.3.4" "@wireapp/api-client" "1.1.13" From 825b4def131f40c203f7176eb260f2be0e174173 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 17:26:04 +0200 Subject: [PATCH 16/99] chore: Update @wireapp/core to version 3.3.1 (#3730) --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index a1b27de08e3..4700f9f6cc5 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.3.0", + "@wireapp/core": "3.3.1", "@wireapp/react-ui-kit": "1.1.43", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 3c96284aa1e..a5503b7dcbc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,9 +503,9 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.1.13": - version "1.1.13" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.13.tgz#1676505a7edb103ddc02e8776111e6c5f46bdea0" +"@wireapp/api-client@1.1.14": + version "1.1.14" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.14.tgz#a06ecb2f9381adf00acdf178dbb61c044400fc9d" dependencies: "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" @@ -523,12 +523,12 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.3.0.tgz#cb4869be4469554c45a65c985eaedeece60ac6bb" +"@wireapp/core@3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.3.1.tgz#a5b4b965452005962bd0240355759e742b0400b6" dependencies: "@types/node" "10.3.4" - "@wireapp/api-client" "1.1.13" + "@wireapp/api-client" "1.1.14" "@wireapp/cryptobox" "8.4.8" "@wireapp/store-engine" "0.11.32" bazinga64 "5.2.4" From 98f34e8cd43047abdb0b8e47b3b42dcb53c60dac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Jun 2018 17:34:16 +0200 Subject: [PATCH 17/99] chore: Update @wireapp/react-ui-kit to version 1.1.44 (#3729) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4700f9f6cc5..f3fc8ddfb88 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.3.1", - "@wireapp/react-ui-kit": "1.1.43", + "@wireapp/react-ui-kit": "1.1.44", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index a5503b7dcbc..00c81328e24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,9 +571,9 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.1.43": - version "1.1.43" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.43.tgz#274864017340c76b32d90481a984c533685f9b82" +"@wireapp/react-ui-kit@1.1.44": + version "1.1.44" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.44.tgz#f0ee8056be2fe3f43f078e94ad1fc7381baaf68d" dependencies: bazinga64 "5.2.4" color "3.0.0" From 80cf8e2f53ec08b1893e4c9ea27112a3c57cd0a2 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Tue, 19 Jun 2018 17:37:47 +0200 Subject: [PATCH 18/99] feat: Add support for Permissions API (#3681) --- app/page/template/_dist/app.htm | 7 +- app/script/main/app.js | 6 +- app/script/media/MediaRepository.js | 5 +- app/script/media/MediaStreamHandler.js | 87 +++++++++++++++++- .../notification/NotificationRepository.js | 81 ++++++++--------- app/script/notification/PermissionState.js | 32 +++++++ app/script/permission/PermissionError.js | 61 +++++++++++++ app/script/permission/PermissionRepository.js | 91 +++++++++++++++++++ .../PermissionStatusState.js | 7 +- app/script/permission/PermissionType.js | 31 +++++++ app/script/util/Environment.js | 8 +- app/script/view_model/WarningsViewModel.js | 8 +- test/api/TestFactory.js | 22 ++++- .../NotificationRepositorySpec.js | 4 +- 14 files changed, 386 insertions(+), 64 deletions(-) create mode 100644 app/script/notification/PermissionState.js create mode 100644 app/script/permission/PermissionError.js create mode 100644 app/script/permission/PermissionRepository.js rename app/script/{notification => permission}/PermissionStatusState.js (84%) create mode 100644 app/script/permission/PermissionType.js diff --git a/app/page/template/_dist/app.htm b/app/page/template/_dist/app.htm index 4f156d4035c..18eef49e2bc 100644 --- a/app/page/template/_dist/app.htm +++ b/app/page/template/_dist/app.htm @@ -230,10 +230,15 @@ - + + + + + + diff --git a/app/script/main/app.js b/app/script/main/app.js index e12b4af7394..cf6a2914300 100644 --- a/app/script/main/app.js +++ b/app/script/main/app.js @@ -88,7 +88,7 @@ z.main.App = class App { repositories.audio = this.auth.audio; repositories.cache = new z.cache.CacheRepository(); repositories.giphy = new z.extension.GiphyRepository(this.service.giphy); - repositories.media = new z.media.MediaRepository(); + repositories.permission = new z.permission.PermissionRepository(); repositories.storage = new z.storage.StorageRepository(this.service.storage); repositories.cryptography = new z.cryptography.CryptographyRepository( @@ -96,6 +96,7 @@ z.main.App = class App { repositories.storage ); repositories.client = new z.client.ClientRepository(this.service.client, repositories.cryptography); + repositories.media = new z.media.MediaRepository(repositories.permission); repositories.user = new z.user.UserRepository( this.service.user, this.service.asset, @@ -163,7 +164,8 @@ z.main.App = class App { ); repositories.notification = new z.notification.NotificationRepository( repositories.calling, - repositories.conversation + repositories.conversation, + repositories.permission ); repositories.videoGrid = new z.calling.VideoGridRepository(repositories.calling, repositories.media); diff --git a/app/script/media/MediaRepository.js b/app/script/media/MediaRepository.js index 5f9e0873b2c..3569622bc4d 100644 --- a/app/script/media/MediaRepository.js +++ b/app/script/media/MediaRepository.js @@ -42,14 +42,15 @@ z.media.MediaRepository = class MediaRepository { /** * Construct a new Media repository. + * @param {z.permission.PermissionRepository} permissionRepository - Repository for all permission interactions */ - constructor() { + constructor(permissionRepository) { this.logger = new z.util.Logger('z.media.MediaRepository', z.config.LOGGER.OPTIONS); this.constraintsHandler = new z.media.MediaConstraintsHandler(this); this.devicesHandler = new z.media.MediaDevicesHandler(this); this.elementHandler = new z.media.MediaElementHandler(this); - this.streamHandler = new z.media.MediaStreamHandler(this); + this.streamHandler = new z.media.MediaStreamHandler(this, permissionRepository); this.audioContext = undefined; } diff --git a/app/script/media/MediaStreamHandler.js b/app/script/media/MediaStreamHandler.js index 6280534b9cb..83a0c71a205 100644 --- a/app/script/media/MediaStreamHandler.js +++ b/app/script/media/MediaStreamHandler.js @@ -81,12 +81,14 @@ z.media.MediaStreamHandler = class MediaStreamHandler { /** * Construct a new MediaStream handler. * @param {z.media.MediaRepository} mediaRepository - Media repository with with references to all other handlers + * @param {z.permission.PermissionRepository} permissionRepository - Repository for all permission interactions */ - constructor(mediaRepository) { + constructor(mediaRepository, permissionRepository) { this._toggleScreenSend = this._toggleScreenSend.bind(this); this._toggleVideoSend = this._toggleVideoSend.bind(this); this.mediaRepository = mediaRepository; + this.permissionRepository = permissionRepository; this.logger = new z.util.Logger('z.media.MediaStreamHandler', z.config.LOGGER.OPTIONS); this.calls = () => []; @@ -288,16 +290,38 @@ z.media.MediaStreamHandler = class MediaStreamHandler { * @returns {Promise} Resolves with the stream and its type */ requestMediaStream(mediaType, mediaStreamConstraints) { - return this._checkDeviceAvailability(mediaType).then(() => { - return this._requestMediaStream(mediaType, mediaStreamConstraints); - }); + return this._checkDeviceAvailability(mediaType) + .then(() => this._checkPermissions(mediaType)) + .then(() => this._requestMediaStream(mediaType, mediaStreamConstraints)) + .catch(error => { + const isPermissionDenied = error.type === z.permission.PermissionError.TYPE.DENIED; + throw isPermissionDenied + ? new z.media.MediaError(z.media.MediaError.TYPE.MEDIA_STREAM_PERMISSION, mediaType) + : error; + }); } + /** + * Add tracks to a new stream. + * + * @private + * @param {MediaStream} sourceStream - MediaStream to take tracks from + * @param {MediaStream} targetStream - MediaStream to add tracks to + * @param {z.media.MediaType} mediaType - Type of track to add + * @returns {undefined} Not return value + */ _addTracksToStream(sourceStream, targetStream, mediaType) { const mediaStreamTracks = MediaStreamHandler.getMediaTracks(sourceStream, mediaType); mediaStreamTracks.forEach(mediaStreamTrack => targetStream.addTrack(mediaStreamTrack)); } + /** + * Check for devices of requested media type. + * + * @private + * @param {z.media.MediaType} mediaType - Requested media type + * @returns {Promise} Resolves when the device availability has been verified + */ _checkDeviceAvailability(mediaType) { const videoTypes = [z.media.MediaType.AUDIO_VIDEO, z.media.MediaType.VIDEO]; const noVideoTypes = !this.deviceSupport.videoInput() && videoTypes.includes(mediaType); @@ -316,6 +340,61 @@ z.media.MediaStreamHandler = class MediaStreamHandler { return Promise.resolve(); } + /** + * Check for permission for the requested media type. + * + * @private + * @param {z.media.MediaType} mediaType - Requested media type + * @returns {Promise} Resolves when the permissions are not denied + */ + _checkPermissions(mediaType) { + if (!z.util.Environment.browser.supports.mediaPermissions) { + return Promise.resolve(); + } + + const checkPermissionStates = typesToCheck => { + return this.permissionRepository.getPermissionStates(typesToCheck).then(permissions => { + for (const permission of permissions) { + const {permissionState, permissionType} = permission; + const isPermissionDenied = permissionState === z.permission.PermissionStatusState.DENIED; + if (isPermissionDenied) { + this.logger.warn(`Permission for '${permissionType}' is set to '${permissionState}'`, permissions); + return Promise.reject(new z.permission.PermissionError(z.permission.PermissionError.TYPE.DENIED)); + } + } + + return Promise.resolve(); + }); + }; + + const permissionTypes = this._getPermissionTypes(mediaType); + const shouldCheckPermissions = permissionTypes && permissionTypes.length; + return shouldCheckPermissions ? checkPermissionStates(permissionTypes) : Promise.resolve(); + } + + /** + * Get permission types for the requested media type. + * + * @private + * @param {z.media.MediaType} mediaType - Requested media type + * @returns {Array} Array containing the necessary permission types + */ + _getPermissionTypes(mediaType) { + switch (mediaType) { + case z.media.MediaType.AUDIO: { + return [z.permission.PermissionType.MICROPHONE]; + } + + case z.media.MediaType.AUDIO_VIDEO: { + return [z.permission.PermissionType.CAMERA, z.permission.PermissionType.MICROPHONE]; + } + + case z.media.MediaType.VIDEO: { + return [z.permission.PermissionType.CAMERA]; + } + } + } + /** * Clear the permission request hint timeout or hide the warning. * diff --git a/app/script/notification/NotificationRepository.js b/app/script/notification/NotificationRepository.js index d14828850f4..3f78e28fc7a 100644 --- a/app/script/notification/NotificationRepository.js +++ b/app/script/notification/NotificationRepository.js @@ -25,7 +25,7 @@ window.z.notification = z.notification || {}; /** * Notification repository to trigger browser and audio notifications. * - * @see https://developer.mozilla.org/en/docs/Web/API/notification + * @see https://developer.mozilla.org/en-US/docs/Web/API/notification * @see http://www.w3.org/TR/notifications */ z.notification.NotificationRepository = class NotificationRepository { @@ -52,11 +52,13 @@ z.notification.NotificationRepository = class NotificationRepository { /** * Construct a new Notification Repository. * @param {z.calling.CallingRepository} callingRepository - Repository for all call interactions - * @param {z.conversation.ConversationService} conversationRepository - Repository for all conversation interactions + * @param {z.conversation.ConversationRepository} conversationRepository - Repository for all conversation interactions + * @param {z.permission.PermissionRepository} permissionRepository - Repository for all permission interactions */ - constructor(callingRepository, conversationRepository) { + constructor(callingRepository, conversationRepository, permissionRepository) { this.callingRepository = callingRepository; this.conversationRepository = conversationRepository; + this.permissionRepository = permissionRepository; this.logger = new z.util.Logger('z.notification.NotificationRepository', z.config.LOGGER.OPTIONS); this.notifications = []; @@ -70,13 +72,12 @@ z.notification.NotificationRepository = class NotificationRepository { } }); - this.permissionState = z.notification.PermissionStatusState.PROMPT; - this.permissionStatus = undefined; + this.permissionState = this.permissionRepository.permissionState[z.permission.PermissionType.NOTIFICATIONS]; } subscribeToEvents() { amplify.subscribe(z.event.WebApp.NOTIFICATION.NOTIFY, this.notify.bind(this)); - amplify.subscribe(z.event.WebApp.NOTIFICATION.PERMISSION_STATE, this.setPermissionState.bind(this)); + amplify.subscribe(z.event.WebApp.NOTIFICATION.PERMISSION_STATE, this.updatePermissionState.bind(this)); amplify.subscribe(z.event.WebApp.NOTIFICATION.REMOVE_READ, this.removeReadNotifications.bind(this)); amplify.subscribe(z.event.WebApp.PROPERTIES.UPDATED, this.updatedProperties.bind(this)); amplify.subscribe(z.event.WebApp.PROPERTIES.UPDATE.NOTIFICATIONS, this.updatedNotificationsProperty.bind(this)); @@ -87,35 +88,28 @@ z.notification.NotificationRepository = class NotificationRepository { * @returns {Promise} Promise that resolves with the permission state */ checkPermission() { - return this._getPermissionState().then(isPermitted => { + return this._checkPermissionState().then(isPermitted => { if (_.isBoolean(isPermitted)) { return isPermitted; } if (!z.util.Environment.browser.supports.notifications) { - return this.setPermissionState(z.notification.PermissionStatusState.UNSUPPORTED); + return this.updatePermissionState(z.notification.PermissionState.UNSUPPORTED); } - if (navigator.permissions) { - return navigator.permissions.query({name: 'notifications'}).then(permissionStatus => { - this.permissionStatus = permissionStatus; - this.permissionStatus.onchange = () => this.setPermissionState(this.permissionStatus.state); - - switch (permissionStatus.state) { - case z.notification.PermissionStatusState.PROMPT: - return this._requestPermission(); - default: - return this.setPermissionState(permissionStatus.state); - } - }); + if (z.util.Environment.browser.supports.permissions) { + return this.permissionRepository + .getPermissionState(z.permission.PermissionType.NOTIFICATIONS) + .then(permissionState => { + const shouldRequestPermission = permissionState === z.permission.PermissionStatusState.PROMPT; + return shouldRequestPermission ? this._requestPermission() : this._checkPermissionState(); + }); } - switch (window.Notification.permission) { - case z.notification.PermissionStatusState.DEFAULT: - return this._requestPermission(); - default: - return this.setPermissionState(window.Notification.permission); - } + const shouldRequestPermission = window.Notification.permission === z.notification.PermissionState.DEFAULT; + return shouldRequestPermission + ? this._requestPermission() + : this.updatePermissionState(window.Notification.permission); }); } @@ -172,16 +166,6 @@ z.notification.NotificationRepository = class NotificationRepository { }); } - /** - * Set the permission state. - * @param {z.notification.PermissionStatusState} permissionState - State of browser permission - * @returns {Promise} Resolves with true if notificaions are enabled - */ - setPermissionState(permissionState) { - this.permissionState = permissionState; - return this._getPermissionState(); - } - updatedProperties(properties) { const notificationPreference = properties.settings.notifications; return this.notificationsPreference(notificationPreference); @@ -191,6 +175,16 @@ z.notification.NotificationRepository = class NotificationRepository { return this.notificationsPreference(notificationPreference); } + /** + * Set the permission state. + * @param {z.permission.PermissionStatusState} permissionState - State of browser permission + * @returns {Promise} Resolves with true if notifications are enabled + */ + updatePermissionState(permissionState) { + this.permissionState(permissionState); + return this._checkPermissionState(); + } + /** * Creates the notification body for calls. * @private @@ -593,14 +587,15 @@ z.notification.NotificationRepository = class NotificationRepository { * @private * @returns {Promise} Resolves with true if notifications are permitted */ - _getPermissionState() { - switch (this.permissionState) { - case z.notification.PermissionStatusState.GRANTED: { + _checkPermissionState() { + switch (this.permissionState()) { + case z.permission.PermissionStatusState.GRANTED: { return Promise.resolve(true); } - case z.notification.PermissionStatusState.IGNORED: - case z.notification.PermissionStatusState.UNSUPPORTED: { + case z.notification.PermissionState.IGNORED: + case z.notification.PermissionState.UNSUPPORTED: + case z.permission.PermissionStatusState.DENIED: { return Promise.resolve(false); } @@ -677,7 +672,7 @@ z.notification.NotificationRepository = class NotificationRepository { if (window.Notification.requestPermission) { window.Notification.requestPermission(permissionState => { amplify.publish(z.event.WebApp.WARNING.DISMISS, z.viewModel.WarningsViewModel.TYPE.REQUEST_NOTIFICATION); - return this.setPermissionState(permissionState).then(resolve); + this.updatePermissionState(permissionState).then(resolve); }); } }); @@ -725,7 +720,7 @@ z.notification.NotificationRepository = class NotificationRepository { const activeConversation = document.hasFocus() && inConversationView && inActiveConversation && !inMaximizedCall; const messageFromSelf = messageEntity.user().is_me; - const permissionDenied = this.permissionState === z.notification.PermissionStatusState.DENIED; + const permissionDenied = this.permissionState() === z.permission.PermissionStatusState.DENIED; const preferenceIsNone = this.notificationsPreference() === z.notification.NotificationPreference.NONE; const supportsNotification = z.util.Environment.browser.supports.notifications; diff --git a/app/script/notification/PermissionState.js b/app/script/notification/PermissionState.js new file mode 100644 index 00000000000..6f4e2c7e7c5 --- /dev/null +++ b/app/script/notification/PermissionState.js @@ -0,0 +1,32 @@ +/* + * Wire + * Copyright (C) 2018 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +'use strict'; + +window.z = window.z || {}; +window.z.notification = z.notification || {}; + +// https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission +z.notification.PermissionState = { + DEFAULT: 'default', + DENIED: 'denied', + GRANTED: 'granted', + IGNORED: 'ignored', + UNSUPPORTED: 'unsupported', +}; diff --git a/app/script/permission/PermissionError.js b/app/script/permission/PermissionError.js new file mode 100644 index 00000000000..8c2027d439c --- /dev/null +++ b/app/script/permission/PermissionError.js @@ -0,0 +1,61 @@ +/* + * Wire + * Copyright (C) 2018 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +'use strict'; + +window.z = window.z || {}; +window.z.permission = z.permission || {}; + +z.permission.PermissionError = class PermissionError extends Error { + constructor(type) { + super(); + this.name = this.constructor.name; + this.stack = new Error().stack; + this.type = type || PermissionError.TYPE.UNKNOWN; + switch (this.type) { + case PermissionError.TYPE.DENIED: { + this.message = 'Permission was denied'; + break; + } + + case PermissionError.TYPE.UNSUPPORTED: { + this.message = 'Permissions API is not supported'; + break; + } + + case PermissionError.TYPE.UNSUPPORTED_TYPE: { + this.message = 'Permissions API does not support requested type'; + break; + } + + default: { + this.message = 'Unknown Permission Error'; + } + } + } + + static get TYPE() { + return { + DENIED: 'PermissionError.TYPE.DENIED', + UNKNOWN: 'PermissionError.TYPE.UNKNOWN', + UNSUPPORTED: 'PermissionError.TYPE.UNSUPPORTED', + UNSUPPORTED_TYPE: 'PermissionError.TYPE.UNSUPPORTED_TYPE', + }; + } +}; diff --git a/app/script/permission/PermissionRepository.js b/app/script/permission/PermissionRepository.js new file mode 100644 index 00000000000..d0c09125b02 --- /dev/null +++ b/app/script/permission/PermissionRepository.js @@ -0,0 +1,91 @@ +/* + * Wire + * Copyright (C) 2018 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +'use strict'; + +window.z = window.z || {}; +window.z.permission = z.permission || {}; + +/** + * Permission repository to check browser permissions. + * + * @see https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API + */ +z.permission.PermissionRepository = class PermissionRepository { + static get CONFIG() { + return { + MEDIA_TYPES: [z.permission.PermissionType.CAMERA, z.permission.PermissionType.MICROPHONE], + }; + } + /** + * Construct a new Permission Repository. + * @param {z.calling.CallingRepository} callingRepository - Repository for all call interactions + * @param {z.conversation.ConversationService} conversationRepository - Repository for all conversation interactions + */ + constructor(callingRepository, conversationRepository) { + this.logger = new z.util.Logger('z.permission.PermissionRepository', z.config.LOGGER.OPTIONS); + + this.permissionState = { + [z.permission.PermissionType.CAMERA]: ko.observable(undefined), + [z.permission.PermissionType.GEO_LOCATION]: ko.observable(undefined), + [z.permission.PermissionType.MICROPHONE]: ko.observable(undefined), + [z.permission.PermissionType.NOTIFICATIONS]: ko.observable(undefined), + }; + } + + checkPermissionState(permissionType) { + return Promise.resolve().then(() => { + if (!z.util.Environment.browser.supports.permissions) { + throw new z.permission.PermissionError(z.permission.PermissionError.TYPE.UNSUPPORTED); + } + + const isMediaPermission = PermissionRepository.CONFIG.MEDIA_TYPES.includes(permissionType); + if (isMediaPermission && !z.util.Environment.browser.supports.mediaPermissions) { + throw new z.permission.PermissionError(z.permission.PermissionError.TYPE.UNSUPPORTED_TYPE); + } + + let status; + return navigator.permissions.query({name: permissionType}).then(permissionStatus => { + status = permissionStatus; + this.logger.log(`Permission for '${permissionType}' is currently '${status.state}'`, status); + + status.onChange = () => { + this.logger.log(`Permission for '${permissionType}' changed to '${status.state}'`, status); + this.permissionState[permissionType](status.state); + }; + + return status.state; + }); + }); + } + + getPermissionState(permissionType) { + return this[permissionType] ? Promise.resolve(this[permissionType]) : this.checkPermissionState(permissionType); + } + + getPermissionStates(permissionTypes) { + const permissionPromises = permissionTypes.map(permissionType => { + return this.getPermissionState(permissionType) + .then(permissionState => ({permissionState, permissionType})) + .catch(() => ({permissionState: z.permission.PermissionStatusState.PROMPT, permissionType})); + }); + + return Promise.all(permissionPromises); + } +}; diff --git a/app/script/notification/PermissionStatusState.js b/app/script/permission/PermissionStatusState.js similarity index 84% rename from app/script/notification/PermissionStatusState.js rename to app/script/permission/PermissionStatusState.js index 139962d7e21..0305d97f5e6 100644 --- a/app/script/notification/PermissionStatusState.js +++ b/app/script/permission/PermissionStatusState.js @@ -20,14 +20,11 @@ 'use strict'; window.z = window.z || {}; -window.z.notification = z.notification || {}; +window.z.permission = z.permission || {}; // https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state -z.notification.PermissionStatusState = { - DEFAULT: 'default', +z.permission.PermissionStatusState = { DENIED: 'denied', GRANTED: 'granted', - IGNORED: 'ignored', PROMPT: 'prompt', - UNSUPPORTED: 'unsupported', }; diff --git a/app/script/permission/PermissionType.js b/app/script/permission/PermissionType.js new file mode 100644 index 00000000000..7dcfcd91f1f --- /dev/null +++ b/app/script/permission/PermissionType.js @@ -0,0 +1,31 @@ +/* + * Wire + * Copyright (C) 2018 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +'use strict'; + +window.z = window.z || {}; +window.z.permission = z.permission || {}; + +// https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query +z.permission.PermissionType = { + CAMERA: 'camera', + GEO_LOCATION: 'geolocation', + MICROPHONE: 'microphone', + NOTIFICATIONS: 'notifications', +}; diff --git a/app/script/util/Environment.js b/app/script/util/Environment.js index 84f04246471..b91c8fb28de 100644 --- a/app/script/util/Environment.js +++ b/app/script/util/Environment.js @@ -102,7 +102,11 @@ z.util.Environment = (() => { return false; } }; - const _supportsMediaDevices = () => !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia); + const _supportsMediaDevices = () => !!navigator.mediaDevices && !!navigator.mediaDevices.getUserMedia; + + const _supportsPermissions = () => !!navigator.permissions; + const _supportsMediaPermissions = () => _supportsPermissions() && _isChrome() && _getVersion() >= 64; + const _supportsNotifications = () => { const notificationNotSupported = window.Notification === undefined; if (notificationNotSupported) { @@ -134,7 +138,9 @@ z.util.Environment = (() => { calling: _supportsCalling(), indexedDb: _supportsIndexedDb(), mediaDevices: _supportsMediaDevices(), + mediaPermissions: _supportsMediaPermissions(), notifications: _supportsNotifications(), + permissions: _supportsPermissions(), screenSharing: _supportsScreenSharing(), }, version: _getVersion(), diff --git a/app/script/view_model/WarningsViewModel.js b/app/script/view_model/WarningsViewModel.js index 5cd194cbe37..63479962fa9 100644 --- a/app/script/view_model/WarningsViewModel.js +++ b/app/script/view_model/WarningsViewModel.js @@ -114,7 +114,7 @@ z.viewModel.WarningsViewModel = class WarningsViewModel { this.dismissWarning(warningToClose); switch (warningToClose) { - case WarningsViewModel.TYPE.REQUEST_MICROPHONE: + case WarningsViewModel.TYPE.REQUEST_MICROPHONE: { amplify.publish(z.event.WebApp.WARNING.MODAL, z.viewModel.ModalsViewModel.TYPE.ACKNOWLEDGE, { action: () => { z.util.safeWindowOpen(z.util.URLUtil.buildSupportUrl(z.config.SUPPORT.ID.MICROPHONE_ACCESS_DENIED)); @@ -126,10 +126,14 @@ z.viewModel.WarningsViewModel = class WarningsViewModel { }, }); break; - case WarningsViewModel.TYPE.REQUEST_NOTIFICATION: + } + + case WarningsViewModel.TYPE.REQUEST_NOTIFICATION: { // We block subsequent permission requests for notifications when the user ignores the request. amplify.publish(z.event.WebApp.NOTIFICATION.PERMISSION_STATE, z.notification.PermissionStatusState.IGNORED); break; + } + default: break; } diff --git a/test/api/TestFactory.js b/test/api/TestFactory.js index 756c3e46a4a..94f13f8db47 100644 --- a/test/api/TestFactory.js +++ b/test/api/TestFactory.js @@ -76,6 +76,19 @@ window.TestFactory.prototype.exposeAuthActors = function() { }); }; +/** + * + * @returns {Promise} The permission repository. + */ +window.TestFactory.prototype.exposePermissionActors = function() { + this.logger.info('- exposePermissionActors'); + return Promise.resolve().then(() => { + TestFactory.permission_repository = new z.permission.PermissionRepository(); + TestFactory.permission_repository.logger.level = this.settings.logging_level; + return TestFactory.permission_repository; + }); +}; + /** * * @returns {Promise} The storage repository. @@ -436,7 +449,11 @@ window.TestFactory.prototype.exposeCallingActors = function() { window.TestFactory.prototype.exposeNotificationActors = function() { this.logger.info('- exposeNotificationActors'); return Promise.resolve() - .then(() => this.exposeConversationActors()) + .then(() => this.exposePermissionActors()) + .then(() => { + this.logger.info('✓ exposedPermissionActors'); + return this.exposeConversationActors(); + }) .then(() => { this.logger.info('✓ exposedConversationActors'); return this.exposeCallingActors(); @@ -446,7 +463,8 @@ window.TestFactory.prototype.exposeNotificationActors = function() { TestFactory.notification_repository = new z.notification.NotificationRepository( TestFactory.calling_repository, - TestFactory.conversation_repository + TestFactory.conversation_repository, + TestFactory.permission_repository ); TestFactory.notification_repository.logger.level = this.settings.logging_level; diff --git a/test/unit_tests/notification/NotificationRepositorySpec.js b/test/unit_tests/notification/NotificationRepositorySpec.js index 62e5d94c9fb..6a87dd17a6e 100644 --- a/test/unit_tests/notification/NotificationRepositorySpec.js +++ b/test/unit_tests/notification/NotificationRepositorySpec.js @@ -71,7 +71,7 @@ describe('z.notification.NotificationRepository', () => { // Mocks document.hasFocus = () => false; - TestFactory.notification_repository.permissionState = z.notification.PermissionStatusState.GRANTED; + TestFactory.notification_repository.permissionState(z.permission.PermissionStatusState.GRANTED); z.util.Environment.browser.supports.notifications = true; window.wire.app = { service: { @@ -285,7 +285,7 @@ describe('z.notification.NotificationRepository', () => { }); it('if the user permission was denied', done => { - TestFactory.notification_repository.permissionState = z.notification.PermissionStatusState.DENIED; + TestFactory.notification_repository.permissionState(z.permission.PermissionStatusState.DENIED); TestFactory.notification_repository .notify(message_et, undefined, conversation_et) From 2bd39c7aa4a8d533179349ceed87f43f85c1d75c Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Tue, 19 Jun 2018 17:59:08 +0200 Subject: [PATCH 19/99] fix: Carousel direction for arrow keys in image detail (#3731) --- .../view_model/ImageDetailViewViewModel.js | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/script/view_model/ImageDetailViewViewModel.js b/app/script/view_model/ImageDetailViewViewModel.js index 72eb636d3f4..ee6e52b0372 100644 --- a/app/script/view_model/ImageDetailViewViewModel.js +++ b/app/script/view_model/ImageDetailViewViewModel.js @@ -94,17 +94,23 @@ z.viewModel.ImageDetailViewViewModel = class ImageDetailViewViewModel { this._loadImage(); $(document).on('keydown.lightbox', keyboardEvent => { switch (keyboardEvent.key) { - case z.util.KeyboardUtil.KEY.ESC: + case z.util.KeyboardUtil.KEY.ESC: { this.clickOnClose(); break; + } + case z.util.KeyboardUtil.KEY.ARROW_DOWN: - case z.util.KeyboardUtil.KEY.ARROW_RIGHT: + case z.util.KeyboardUtil.KEY.ARROW_RIGHT: { this.clickOnShowNext(this, keyboardEvent); break; + } + case z.util.KeyboardUtil.KEY.ARROW_LEFT: - case z.util.KeyboardUtil.KEY.ARROW_UP: + case z.util.KeyboardUtil.KEY.ARROW_UP: { this.clickOnShowPrevious(this, keyboardEvent); break; + } + default: break; } @@ -165,20 +171,19 @@ z.viewModel.ImageDetailViewViewModel = class ImageDetailViewViewModel { clickOnShowNext(imageDetailViewViewModel, event) { event.stopPropagation(); - const nextMessageEntity = z.util.ArrayUtil.iterateItem(this.items(), this.messageEntity()); - - if (nextMessageEntity) { - this.messageEntity(nextMessageEntity); - this._loadImage(); - } + this._iterateImage(true); } clickOnShowPrevious(imageDetailViewViewModel, event) { event.stopPropagation(); - const previousMessageEntity = z.util.ArrayUtil.iterateItem(this.items(), this.messageEntity(), true); + this._iterateImage(false); + } + + _iterateImage(reverse) { + const messageEntity = z.util.ArrayUtil.iterateItem(this.items(), this.messageEntity(), reverse); - if (previousMessageEntity) { - this.messageEntity(z.util.ArrayUtil.iterateItem(this.items(), this.messageEntity(), true)); + if (messageEntity) { + this.messageEntity(messageEntity); this._loadImage(); } } From f4c1b3117f0e349e05ccb31b2e5ff5fbb07bfb8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Jun 2018 09:37:55 +0200 Subject: [PATCH 20/99] chore: Update uglify-js to version 3.4.1 (#3732) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f3fc8ddfb88..b18532a2df5 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "stylelint": "9.3.0", "stylelint-config-idiomatic-order": "5.0.0", "stylelint-config-prettier": "3.2.0", - "uglify-js": "3.4.0", + "uglify-js": "3.4.1", "uglifyjs-webpack-plugin": "1.2.5", "webpack": "4.12.0", "webpack-cli": "3.0.8", diff --git a/yarn.lock b/yarn.lock index 00c81328e24..87585fb10c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10415,9 +10415,9 @@ uglify-es@^3.3.4: commander "~2.13.0" source-map "~0.6.1" -uglify-js@3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.0.tgz#796762282b5b5f0eafe7d5c8c708d1d7bd5ba11d" +uglify-js@3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.1.tgz#006da540dc25e9319d106a99a5ef1d24ae04ce60" dependencies: commander "~2.15.0" source-map "~0.6.1" From 3cda0a7b6f3f0e2046b9f10a3b230711820be1cc Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 20 Jun 2018 12:21:17 +0200 Subject: [PATCH 21/99] fix: Change marketing consent decline copy again (#3737) --- app/script/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/script/strings.js b/app/script/strings.js index 3459e795d54..850ed1a6272 100644 --- a/app/script/strings.js +++ b/app/script/strings.js @@ -228,7 +228,7 @@ export const acceptNewsModalStrings = defineMessages({ }, declineButton: { id: 'acceptNewsModal.declineButton', - defaultMessage: 'Decline', + defaultMessage: 'No, thanks', }, confirmButton: { id: 'acceptNewsModal.confirmButton', From b7e1c796545f095ecc563e9366830efb9f8a2728 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Jun 2018 12:25:45 +0200 Subject: [PATCH 22/99] chore: Update @wireapp/core to version 3.4.0 (#3736) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b18532a2df5..f7f150fd42e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.3.1", + "@wireapp/core": "3.4.0", "@wireapp/react-ui-kit": "1.1.44", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 87585fb10c0..368bd24852f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -523,9 +523,9 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.3.1": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.3.1.tgz#a5b4b965452005962bd0240355759e742b0400b6" +"@wireapp/core@3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.4.0.tgz#8bcab510ed2ec1539da8069f9772b0a1be86dd2d" dependencies: "@types/node" "10.3.4" "@wireapp/api-client" "1.1.14" From 9f3f20014942604f74b706c7c8a745e2a5f21c51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Jun 2018 15:14:19 +0200 Subject: [PATCH 23/99] chore: Update @wireapp/core to version 3.4.1 (#3739) --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f7f150fd42e..0460fc9c4de 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.4.0", + "@wireapp/core": "3.4.1", "@wireapp/react-ui-kit": "1.1.44", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 368bd24852f..33a8e362318 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,9 +503,9 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.1.14": - version "1.1.14" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.1.14.tgz#a06ecb2f9381adf00acdf178dbb61c044400fc9d" +"@wireapp/api-client@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.2.0.tgz#c89857b8f27fbdaf42e7ab15acf982c4366fcd33" dependencies: "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" @@ -523,12 +523,12 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.4.0.tgz#8bcab510ed2ec1539da8069f9772b0a1be86dd2d" +"@wireapp/core@3.4.1": + version "3.4.1" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.4.1.tgz#6b092e42d3d4ecbd6b18c2a0df53eaeb4e41e668" dependencies: "@types/node" "10.3.4" - "@wireapp/api-client" "1.1.14" + "@wireapp/api-client" "1.2.0" "@wireapp/cryptobox" "8.4.8" "@wireapp/store-engine" "0.11.32" bazinga64 "5.2.4" From 795676aa1d7cab14fab81974f57d588be9bb142f Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 20 Jun 2018 15:57:58 +0200 Subject: [PATCH 24/99] chore: Remove obsolete ternary (#3740) --- app/script/calling/CallingRepository.js | 2 +- app/script/conversation/ConversationMapper.js | 6 +++--- app/script/conversation/ConversationRepository.js | 8 +++----- app/script/util/PromiseQueue.js | 2 +- app/script/view_model/PanelViewModel.js | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/script/calling/CallingRepository.js b/app/script/calling/CallingRepository.js index 5127ae0b1c2..06b5305ae04 100644 --- a/app/script/calling/CallingRepository.js +++ b/app/script/calling/CallingRepository.js @@ -1162,7 +1162,7 @@ z.calling.CallingRepository = class CallingRepository { _joinCall(conversationId, mediaType, callState, callEntity) { this._checkCallingSupport(conversationId, mediaType, callState) .then(() => this._checkConcurrentJoinedCall(conversationId, callState)) - .then(() => (callEntity ? callEntity : this._initiateOutgoingCall(conversationId, mediaType, callState))) + .then(() => callEntity || this._initiateOutgoingCall(conversationId, mediaType, callState)) .then(callEntityToJoin => this._initiateMediaStream(callEntityToJoin, mediaType)) .then(callEntityToJoin => this._initiateJoinCall(callEntityToJoin, mediaType)); } diff --git a/app/script/conversation/ConversationMapper.js b/app/script/conversation/ConversationMapper.js index 9e207c4fac1..e35c8ff4b8d 100644 --- a/app/script/conversation/ConversationMapper.js +++ b/app/script/conversation/ConversationMapper.js @@ -187,7 +187,7 @@ z.conversation.ConversationMapper = class ConversationMapper { conversation_et.participating_user_ids(participatingUserIds); // Team ID from database or backend payload - const team_id = conversation_data.team_id ? conversation_data.team_id : conversation_data.team; + const team_id = conversation_data.team_id || conversation_data.team; if (team_id) { conversation_et.team_id = team_id; } @@ -197,8 +197,8 @@ z.conversation.ConversationMapper = class ConversationMapper { } // Access related data - const accessModes = conversation_data.accessModes ? conversation_data.accessModes : conversation_data.access; - const accessRole = conversation_data.accessRole ? conversation_data.accessRole : conversation_data.access_role; + const accessModes = conversation_data.accessModes || conversation_data.access; + const accessRole = conversation_data.accessRole || conversation_data.access_role; if (accessModes && accessRole) { this.mapAccessState(conversation_et, accessModes, accessRole); } diff --git a/app/script/conversation/ConversationRepository.js b/app/script/conversation/ConversationRepository.js index 57dd89fc790..1ed5098f9f2 100644 --- a/app/script/conversation/ConversationRepository.js +++ b/app/script/conversation/ConversationRepository.js @@ -1703,12 +1703,10 @@ z.conversation.ConversationRepository = class ConversationRepository { * @returns {Promise} Resolves when the asset failure was sent */ send_asset_upload_failed(conversation_et, messageId, reason = z.assets.AssetUploadFailedReason.FAILED) { - const reason_proto = - reason === z.assets.AssetUploadFailedReason.CANCELLED - ? z.proto.Asset.NotUploaded.CANCELLED - : z.proto.Asset.NotUploaded.FAILED; + const wasCancelled = reason === z.assets.AssetUploadFailedReason.CANCELLED; + const protoReason = wasCancelled ? z.proto.Asset.NotUploaded.CANCELLED : z.proto.Asset.NotUploaded.FAILED; const asset = new z.proto.Asset(); - asset.set('not_uploaded', reason_proto); + asset.set('not_uploaded', protoReason); const generic_message = new z.proto.GenericMessage(messageId); generic_message.set(z.cryptography.GENERIC_MESSAGE_TYPE.ASSET, asset); diff --git a/app/script/util/PromiseQueue.js b/app/script/util/PromiseQueue.js index 9edd2898b72..19c7e900725 100644 --- a/app/script/util/PromiseQueue.js +++ b/app/script/util/PromiseQueue.js @@ -42,7 +42,7 @@ z.util.PromiseQueue = class PromiseQueue { constructor(options = {}) { const {concurrent = 1, name, paused = false, timeout = PromiseQueue.CONFIG.UNBLOCK_INTERVAL} = options; - const loggerName = name ? `z.util.PromiseQueue (${name})` : 'z.util.PromiseQueue'; + const loggerName = `z.util.PromiseQueue${name ? ` (${name})` : ''}`; this.logger = new z.util.Logger(loggerName, z.config.LOGGER.OPTIONS); this._blocked = false; diff --git a/app/script/view_model/PanelViewModel.js b/app/script/view_model/PanelViewModel.js index 4dea8d8e3ee..b87ec5dff42 100644 --- a/app/script/view_model/PanelViewModel.js +++ b/app/script/view_model/PanelViewModel.js @@ -229,8 +229,8 @@ z.viewModel.PanelViewModel = class PanelViewModel { const oldPanel = $(`#${this._getElementIdOfPanel(this.state())}`); const newPanel = this._showPanel(newState); - newPanel.addClass(fromLeft ? 'panel__page--move-in--left' : 'panel__page--move-in--right'); - oldPanel.addClass(fromLeft ? 'panel__page--move-out--left' : 'panel__page--move-out--right'); + newPanel.addClass(`panel__page--move-in${fromLeft ? '--left' : '--right'}`); + oldPanel.addClass(`panel__page--move-out${fromLeft ? '--left' : '--right'}`); window.setTimeout(() => { newPanel.removeClass('panel__page--move-in--left panel__page--move-in--right'); From 4350b94e42bcbdad4819229593f3ea4ea195d187 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Jun 2018 15:58:58 +0200 Subject: [PATCH 25/99] chore: Update redux-devtools-extension to 2.13.3 (#3741) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0460fc9c4de..eb70796f25c 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "raf": "3.4.0", "react-addons-test-utils": "15.6.2", "react-hot-loader": "4.3.3", - "redux-devtools-extension": "2.13.2", + "redux-devtools-extension": "2.13.3", "redux-mock-store": "1.5.3", "request": "2.87.0", "sinon": "6.0.0", diff --git a/yarn.lock b/yarn.lock index 33a8e362318..740b7017848 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8785,9 +8785,9 @@ reduce-function-call@^1.0.1, reduce-function-call@^1.0.2: dependencies: balanced-match "^0.4.2" -redux-devtools-extension@2.13.2: - version "2.13.2" - resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.2.tgz#e0f9a8e8dfca7c17be92c7124958a3b94eb2911d" +redux-devtools-extension@2.13.3: + version "2.13.3" + resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.3.tgz#a75e9a7288c4849424974ae41b57ad9762ddb0c8" redux-logger@3.0.6: version "3.0.6" From ad316c160c37c3564ae02116b7cb55ceace36588 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Jun 2018 18:24:45 +0200 Subject: [PATCH 26/99] chore: Update uglifyjs-webpack-plugin to version 1.2.6 (#3742) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index eb70796f25c..3a9934248c7 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "stylelint-config-idiomatic-order": "5.0.0", "stylelint-config-prettier": "3.2.0", "uglify-js": "3.4.1", - "uglifyjs-webpack-plugin": "1.2.5", + "uglifyjs-webpack-plugin": "1.2.6", "webpack": "4.12.0", "webpack-cli": "3.0.8", "webpack-dev-server": "3.1.4" diff --git a/yarn.lock b/yarn.lock index 740b7017848..f1a3447e103 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10444,9 +10444,9 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uglifyjs-webpack-plugin@1.2.5, uglifyjs-webpack-plugin@^1.2.4: - version "1.2.5" - resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz#2ef8387c8f1a903ec5e44fa36f9f3cbdcea67641" +uglifyjs-webpack-plugin@1.2.6, uglifyjs-webpack-plugin@^1.2.4: + version "1.2.6" + resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.6.tgz#f4bb44f02431e82b301d8d4624330a6a35729381" dependencies: cacache "^10.0.4" find-cache-dir "^1.0.0" From 4d1d417ced4dabbd2b69f56c2a591a55e0660969 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 20 Jun 2018 18:34:08 +0200 Subject: [PATCH 27/99] chore: Update redux-devtools-extension to version 2.13.4 (#3746) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3a9934248c7..c8c7ed2f6b8 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "raf": "3.4.0", "react-addons-test-utils": "15.6.2", "react-hot-loader": "4.3.3", - "redux-devtools-extension": "2.13.3", + "redux-devtools-extension": "2.13.4", "redux-mock-store": "1.5.3", "request": "2.87.0", "sinon": "6.0.0", diff --git a/yarn.lock b/yarn.lock index f1a3447e103..50b1fbe93f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8785,9 +8785,9 @@ reduce-function-call@^1.0.1, reduce-function-call@^1.0.2: dependencies: balanced-match "^0.4.2" -redux-devtools-extension@2.13.3: - version "2.13.3" - resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.3.tgz#a75e9a7288c4849424974ae41b57ad9762ddb0c8" +redux-devtools-extension@2.13.4: + version "2.13.4" + resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.4.tgz#f89b6c0da27c3321e20b8c100801d32a7c8420f5" redux-logger@3.0.6: version "3.0.6" From 5a8c6ad39c9601e0dd713faa17babc978f2e7858 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Thu, 21 Jun 2018 13:06:53 +0200 Subject: [PATCH 28/99] fix: Permission state handling for notifications and media (#3747) --- app/script/calling/CallingRepository.js | 53 +++++------------- app/script/calling/entities/CallEntity.js | 8 +-- .../calling/entities/ParticipantEntity.js | 8 +-- app/script/media/MediaStreamHandler.js | 56 +++++++++++-------- .../notification/NotificationRepository.js | 40 ++++++------- app/script/permission/PermissionRepository.js | 19 ++++--- 6 files changed, 75 insertions(+), 109 deletions(-) diff --git a/app/script/calling/CallingRepository.js b/app/script/calling/CallingRepository.js index 06b5305ae04..92d39a79370 100644 --- a/app/script/calling/CallingRepository.js +++ b/app/script/calling/CallingRepository.js @@ -446,14 +446,7 @@ z.calling.CallingRepository = class CallingRepository { } if (!callEntity.selfClientJoined()) { - const logMessage = { - data: { - default: [conversationId], - obfuscated: [this.callLogger.obfuscate(conversationId)], - }, - message: `Rejecting call in conversation '{0}'`, - }; - this.callLogger.info(logMessage, callEntity); + this.callLogger.info(`Rejecting call in conversation '${conversationId}'`, callEntity); callEntity.rejectCall(false); } }) @@ -1164,7 +1157,12 @@ z.calling.CallingRepository = class CallingRepository { .then(() => this._checkConcurrentJoinedCall(conversationId, callState)) .then(() => callEntity || this._initiateOutgoingCall(conversationId, mediaType, callState)) .then(callEntityToJoin => this._initiateMediaStream(callEntityToJoin, mediaType)) - .then(callEntityToJoin => this._initiateJoinCall(callEntityToJoin, mediaType)); + .then(callEntityToJoin => this._initiateJoinCall(callEntityToJoin, mediaType)) + .catch(error => { + this.callLogger.warn(`Failed to join call in conversation '${conversationId}'`, error); + const isOutgoingCall = !callEntity; + return isOutgoingCall ? this.deleteCall(conversationId) : this.rejectCall(conversationId, true); + }); } /** @@ -1645,46 +1643,21 @@ z.calling.CallingRepository = class CallingRepository { _logMessage(isOutgoing, callMessageEntity, date = new Date().toISOString()) { const {conversationId, destinationUserId, remoteUserId, response, type, userId} = callMessageEntity; - let logMessage; + let log; + const target = `conversation '${conversationId}'`; if (isOutgoing) { - if (remoteUserId) { - logMessage = { - data: { - default: [type, response, remoteUserId, conversationId], - obfuscated: [ - type, - response, - this.callLogger.obfuscate(remoteUserId), - this.callLogger.obfuscate(conversationId), - ], - }, - message: `Sending '{0}' message (response: {1}) to user '{2}' in conversation '{3}'`, - }; - } else { - logMessage = { - data: { - default: [type, response, conversationId], - obfuscated: [type, response, this.callLogger.obfuscate(conversationId)], - }, - message: `Sending '{0}' message (response: {1}) to conversation '{2}'`, - }; - } + const additionalMessage = remoteUserId ? `user '${remoteUserId}' in ${target}` : `${target}`; + log = `Sending '${type}' message (response: ${response}) to ${additionalMessage}`; } else { const isSelfUser = destinationUserId === this.selfUserId(); if (destinationUserId && !isSelfUser) { return; } - logMessage = { - data: { - default: [type, response, userId, conversationId], - obfuscated: [type, response, this.callLogger.obfuscate(userId), this.callLogger.obfuscate(conversationId)], - }, - message: `Received '{0}' message (response: {1}) from user '{2}' in conversation '{3}'`, - }; + log = `Received '${type}' message (response: ${response}) from user '${userId}' in ${target}`; } - this.callLogger.info(logMessage, callMessageEntity); + this.callLogger.info(log, callMessageEntity); } /** diff --git a/app/script/calling/entities/CallEntity.js b/app/script/calling/entities/CallEntity.js index a7899edb259..e5906eeed09 100644 --- a/app/script/calling/entities/CallEntity.js +++ b/app/script/calling/entities/CallEntity.js @@ -63,13 +63,7 @@ z.calling.entities.CallEntity = class CallEntity { const loggerName = 'z.calling.entities.CallEntity'; this.callLogger = new z.telemetry.calling.CallLogger(loggerName, this.id, z.config.LOGGER.OPTIONS, this.messageLog); - this.callLogger.info({ - data: { - default: [this.id], - obfuscated: [this.callLogger.obfuscate(this.id)], - }, - message: `Created new call entity in conversation {0}`, - }); + this.callLogger.info(`Created new call entity in conversation ${this.id}`); // IDs and references this.timings = undefined; diff --git a/app/script/calling/entities/ParticipantEntity.js b/app/script/calling/entities/ParticipantEntity.js index a86b2509806..6a986b23be7 100644 --- a/app/script/calling/entities/ParticipantEntity.js +++ b/app/script/calling/entities/ParticipantEntity.js @@ -55,13 +55,7 @@ z.calling.entities.ParticipantEntity = class ParticipantEntity { const loggerName = 'z.calling.entities.ParticipantEntity'; this.callLogger = new z.telemetry.calling.CallLogger(loggerName, this.id, z.config.LOGGER.OPTIONS, this.messageLog); - this.callLogger.info({ - data: { - default: [this.id], - obfuscated: [this.callLogger.obfuscate(this.id)], - }, - message: `Created new participant entity for user {0}`, - }); + this.callLogger.info(`Created new participant entity for user ${this.id}`); this.isConnected = ko.observable(false); this.panning = ko.observable(0.0); diff --git a/app/script/media/MediaStreamHandler.js b/app/script/media/MediaStreamHandler.js index 83a0c71a205..05aa3e5b124 100644 --- a/app/script/media/MediaStreamHandler.js +++ b/app/script/media/MediaStreamHandler.js @@ -291,8 +291,8 @@ z.media.MediaStreamHandler = class MediaStreamHandler { */ requestMediaStream(mediaType, mediaStreamConstraints) { return this._checkDeviceAvailability(mediaType) - .then(() => this._checkPermissions(mediaType)) - .then(() => this._requestMediaStream(mediaType, mediaStreamConstraints)) + .then(() => this._hasPermissionToAccess(mediaType)) + .then(hasPermission => this._requestMediaStream(mediaType, mediaStreamConstraints, hasPermission)) .catch(error => { const isPermissionDenied = error.type === z.permission.PermissionError.TYPE.DENIED; throw isPermissionDenied @@ -345,31 +345,37 @@ z.media.MediaStreamHandler = class MediaStreamHandler { * * @private * @param {z.media.MediaType} mediaType - Requested media type - * @returns {Promise} Resolves when the permissions are not denied + * @returns {Promise} Resolves true when permissions is granted */ - _checkPermissions(mediaType) { + _hasPermissionToAccess(mediaType) { if (!z.util.Environment.browser.supports.mediaPermissions) { - return Promise.resolve(); + return Promise.resolve(false); } const checkPermissionStates = typesToCheck => { return this.permissionRepository.getPermissionStates(typesToCheck).then(permissions => { for (const permission of permissions) { const {permissionState, permissionType} = permission; + const isPermissionPrompt = permissionState === z.permission.PermissionStatusState.PROMPT; + if (isPermissionPrompt) { + this.logger.info(`Need to prompt for '${permissionType}' permission`, permissions); + return Promise.resolve(false); + } + const isPermissionDenied = permissionState === z.permission.PermissionStatusState.DENIED; if (isPermissionDenied) { - this.logger.warn(`Permission for '${permissionType}' is set to '${permissionState}'`, permissions); + this.logger.warn(`Permission for '${permissionType}' is denied`, permissions); return Promise.reject(new z.permission.PermissionError(z.permission.PermissionError.TYPE.DENIED)); } } - return Promise.resolve(); + return Promise.resolve(true); }); }; const permissionTypes = this._getPermissionTypes(mediaType); const shouldCheckPermissions = permissionTypes && permissionTypes.length; - return shouldCheckPermissions ? checkPermissionStates(permissionTypes) : Promise.resolve(); + return shouldCheckPermissions ? checkPermissionStates(permissionTypes) : Promise.resolve(true); } /** @@ -472,16 +478,9 @@ z.media.MediaStreamHandler = class MediaStreamHandler { const {type, mediaType} = error; const isStreamDeviceError = type === z.media.MediaError.TYPE.MEDIA_STREAM_DEVICE; - if (isStreamDeviceError) { - return this._showDeviceNotFoundHint(mediaType, conversationId); - } - - const isStreamPermissionError = type === z.media.MediaError.TYPE.MEDIA_STREAM_PERMISSION; - if (isStreamPermissionError) { - return this._showPermissionDeniedHint(mediaType); - } - - this._showPermissionDeniedHint(mediaType); + return isStreamDeviceError + ? this._showDeviceNotFoundHint(mediaType, conversationId) + : this._showPermissionDeniedHint(mediaType); } /** @@ -521,21 +520,30 @@ z.media.MediaStreamHandler = class MediaStreamHandler { return false; } + _schedulePermissionHint(mediaType) { + this.requestHintTimeout = window.setTimeout(() => { + this._hidePermissionFailedHint(mediaType); + this._showPermissionRequestHint(mediaType); + this.requestHintTimeout = undefined; + }, MediaStreamHandler.CONFIG.PERMISSION_HINT_DELAY); + } + /** * Request a MediaStream. * * @private * @param {z.media.MediaType} mediaType - Type of MediaStream to be requested * @param {RTCMediaStreamConstraints} mediaStreamConstraints - Constraints for the MediaStream to be requested + * @param {boolean} hasPermission - Has required media permissions * @returns {Promise} Resolves with the stream and its type */ - _requestMediaStream(mediaType, mediaStreamConstraints) { + _requestMediaStream(mediaType, mediaStreamConstraints, hasPermission) { this.logger.info(`Requesting MediaStream access for '${mediaType}'`, mediaStreamConstraints); - this.requestHintTimeout = window.setTimeout(() => { - this._hidePermissionFailedHint(mediaType); - this._showPermissionRequestHint(mediaType); - this.requestHintTimeout = undefined; - }, MediaStreamHandler.CONFIG.PERMISSION_HINT_DELAY); + + const willPromptForPermission = !hasPermission && !z.util.Environment.desktop; + if (willPromptForPermission) { + this._schedulePermissionHint(mediaType); + } return navigator.mediaDevices .getUserMedia(mediaStreamConstraints) diff --git a/app/script/notification/NotificationRepository.js b/app/script/notification/NotificationRepository.js index 3f78e28fc7a..9fda710b50f 100644 --- a/app/script/notification/NotificationRepository.js +++ b/app/script/notification/NotificationRepository.js @@ -98,18 +98,15 @@ z.notification.NotificationRepository = class NotificationRepository { } if (z.util.Environment.browser.supports.permissions) { - return this.permissionRepository - .getPermissionState(z.permission.PermissionType.NOTIFICATIONS) - .then(permissionState => { - const shouldRequestPermission = permissionState === z.permission.PermissionStatusState.PROMPT; - return shouldRequestPermission ? this._requestPermission() : this._checkPermissionState(); - }); + return this.permissionRepository.getPermissionState(z.permission.PermissionType.NOTIFICATIONS).then(() => { + const shouldRequestPermission = this.permissionState() === z.permission.PermissionStatusState.PROMPT; + return shouldRequestPermission ? this._requestPermission() : this._checkPermissionState(); + }); } - const shouldRequestPermission = window.Notification.permission === z.notification.PermissionState.DEFAULT; - return shouldRequestPermission - ? this._requestPermission() - : this.updatePermissionState(window.Notification.permission); + const currentPermission = window.Notification.permission; + const shouldRequestPermission = currentPermission === z.notification.PermissionState.DEFAULT; + return shouldRequestPermission ? this._requestPermission() : this.updatePermissionState(currentPermission); }); } @@ -583,7 +580,7 @@ z.notification.NotificationRepository = class NotificationRepository { } /** - * Evaluates the current permission state + * Evaluates the current permission state. * @private * @returns {Promise} Resolves with true if notifications are permitted */ @@ -620,9 +617,7 @@ z.notification.NotificationRepository = class NotificationRepository { .then(() => this._createNotificationContent(messageEntity, connectionEntity, conversationEntity)) .then(notificationContent => { return this.checkPermission().then(isPermitted => { - if (isPermitted) { - return this._showNotification(notificationContent); - } + return isPermitted ? this._showNotification(notificationContent) : undefined; }); }) .catch(error => { @@ -641,19 +636,18 @@ z.notification.NotificationRepository = class NotificationRepository { */ _notifySound(messageEntity) { const muteSound = !document.hasFocus() && z.util.Environment.browser.firefox && z.util.Environment.os.mac; - if (!muteSound) { + const isFromSelf = messageEntity.user().is_me; + const shouldPlaySound = !muteSound && !isFromSelf; + + if (shouldPlaySound) { switch (messageEntity.super_type) { case z.message.SuperType.CONTENT: { - if (!messageEntity.user().is_me) { - amplify.publish(z.event.WebApp.AUDIO.PLAY, z.audio.AudioType.NEW_MESSAGE); - } + amplify.publish(z.event.WebApp.AUDIO.PLAY, z.audio.AudioType.NEW_MESSAGE); break; } case z.message.SuperType.PING: { - if (!messageEntity.user().is_me) { - amplify.publish(z.event.WebApp.AUDIO.PLAY, z.audio.AudioType.INCOMING_PING); - } + amplify.publish(z.event.WebApp.AUDIO.PLAY, z.audio.AudioType.INCOMING_PING); break; } @@ -787,8 +781,8 @@ z.notification.NotificationRepository = class NotificationRepository { this.logger.info(`Removed notification for ${messageInfo} in '${conversationId}' locally.`); }; - notification.onerror = () => { - this.logger.error(`Notification for ${messageInfo} in '${conversationId}' closed by error.`); + notification.onerror = error => { + this.logger.error(`Notification for ${messageInfo} in '${conversationId}' closed by error.`, error); notification.close(); }; diff --git a/app/script/permission/PermissionRepository.js b/app/script/permission/PermissionRepository.js index d0c09125b02..e375fcfdaef 100644 --- a/app/script/permission/PermissionRepository.js +++ b/app/script/permission/PermissionRepository.js @@ -51,6 +51,8 @@ z.permission.PermissionRepository = class PermissionRepository { checkPermissionState(permissionType) { return Promise.resolve().then(() => { + const setPermissionState = permissionState => this.permissionState[permissionType](permissionState); + if (!z.util.Environment.browser.supports.permissions) { throw new z.permission.PermissionError(z.permission.PermissionError.TYPE.UNSUPPORTED); } @@ -60,23 +62,24 @@ z.permission.PermissionRepository = class PermissionRepository { throw new z.permission.PermissionError(z.permission.PermissionError.TYPE.UNSUPPORTED_TYPE); } - let status; return navigator.permissions.query({name: permissionType}).then(permissionStatus => { - status = permissionStatus; - this.logger.log(`Permission for '${permissionType}' is currently '${status.state}'`, status); + this.logger.log(`Permission state for '${permissionType}' is '${permissionStatus.state}'`, permissionStatus); + setPermissionState(permissionStatus.state); - status.onChange = () => { - this.logger.log(`Permission for '${permissionType}' changed to '${status.state}'`, status); - this.permissionState[permissionType](status.state); + permissionStatus.onchange = () => { + const logMessage = `Permission state for '${permissionType}' changed to '${permissionStatus.state}'`; + this.logger.log(logMessage, permissionStatus); + setPermissionState(permissionStatus.state); }; - return status.state; + return permissionStatus.state; }); }); } getPermissionState(permissionType) { - return this[permissionType] ? Promise.resolve(this[permissionType]) : this.checkPermissionState(permissionType); + const currentPermissionState = this.permissionState[permissionType](); + return currentPermissionState ? Promise.resolve(currentPermissionState) : this.checkPermissionState(permissionType); } getPermissionStates(permissionTypes) { From 740c4a6262108319ce7fbcb3284e86ed5dfdd9e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 21 Jun 2018 13:50:03 +0200 Subject: [PATCH 29/99] chore: Update stylelint-config-prettier to version 3.3.0 (#3748) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c8c7ed2f6b8..37f3d79bb0d 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "sinon": "6.0.0", "stylelint": "9.3.0", "stylelint-config-idiomatic-order": "5.0.0", - "stylelint-config-prettier": "3.2.0", + "stylelint-config-prettier": "3.3.0", "uglify-js": "3.4.1", "uglifyjs-webpack-plugin": "1.2.6", "webpack": "4.12.0", diff --git a/yarn.lock b/yarn.lock index 50b1fbe93f0..50529509ba9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9951,9 +9951,9 @@ stylelint-config-idiomatic-order@5.0.0: stylelint-config-standard "^16.0.0" stylelint-order "^0.5.0" -stylelint-config-prettier@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/stylelint-config-prettier/-/stylelint-config-prettier-3.2.0.tgz#af32b7845adeeddbf0a0bd642ace4ca1e68958e2" +stylelint-config-prettier@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stylelint-config-prettier/-/stylelint-config-prettier-3.3.0.tgz#cc22a4b5310c1919cee77131d6e220c60a62a480" dependencies: stylelint "^9.1.1" From acb5a72f8ff5df4e3ae886612e708342e033678c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 21 Jun 2018 13:53:43 +0200 Subject: [PATCH 30/99] chore: Update redux-devtools-extension to version 2.13.5 (#3749) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 37f3d79bb0d..8c55f5617db 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "raf": "3.4.0", "react-addons-test-utils": "15.6.2", "react-hot-loader": "4.3.3", - "redux-devtools-extension": "2.13.4", + "redux-devtools-extension": "2.13.5", "redux-mock-store": "1.5.3", "request": "2.87.0", "sinon": "6.0.0", diff --git a/yarn.lock b/yarn.lock index 50529509ba9..912b3d5b0a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8785,9 +8785,9 @@ reduce-function-call@^1.0.1, reduce-function-call@^1.0.2: dependencies: balanced-match "^0.4.2" -redux-devtools-extension@2.13.4: - version "2.13.4" - resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.4.tgz#f89b6c0da27c3321e20b8c100801d32a7c8420f5" +redux-devtools-extension@2.13.5: + version "2.13.5" + resolved "https://registry.yarnpkg.com/redux-devtools-extension/-/redux-devtools-extension-2.13.5.tgz#3ff34f7227acfeef3964194f5f7fc2765e5c5a39" redux-logger@3.0.6: version "3.0.6" From 9e9cb3b027fa4a36b331cfb00a3f13c93aeeaa8c Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Thu, 21 Jun 2018 14:33:22 +0200 Subject: [PATCH 31/99] chore: Update raygun4js to version 2.10.0 (#3751) --- .../tracking/EventTrackingRepository.js | 32 --------------- package.json | 2 +- .../tracking/EventTrackingRepositorySpec.js | 41 ------------------- yarn.lock | 6 +-- 4 files changed, 4 insertions(+), 77 deletions(-) diff --git a/app/script/tracking/EventTrackingRepository.js b/app/script/tracking/EventTrackingRepository.js index 99a5ae57a42..2ab0892ebec 100644 --- a/app/script/tracking/EventTrackingRepository.js +++ b/app/script/tracking/EventTrackingRepository.js @@ -282,32 +282,6 @@ z.tracking.EventTrackingRepository = class EventTrackingRepository { // Raygun //############################################################################## - /** - * Attach to rejected Promises. - * @returns {undefined} No return value - */ - _attach_promise_rejection_handler() { - window.onunhandledrejection = ({reason: error, promise: rejected_promise}) => { - if (window.onerror) { - if (error) { - if (_.isString(error)) { - window.onerror.call(this, error, null, null, null); - } else if (error.message) { - window.onerror.call(this, error.message, error.fileName, error.lineNumber, error.columnNumber, error); - } - } - - if (rejected_promise) { - window.setTimeout(() => { - rejected_promise.catch(promise_error => { - this.logger.log(this.logger.levels.OFF, 'Handled uncaught Promise in error reporting', promise_error); - }); - }, 0); - } - } - }; - } - /** * Checks if a Raygun payload should be reported. * @@ -330,16 +304,11 @@ z.tracking.EventTrackingRepository = class EventTrackingRepository { return false; } - _detach_promise_rejection_handler() { - window.onunhandledrejection = undefined; - } - _disable_error_reporting() { this.logger.debug('Disabling Raygun error reporting'); this.is_error_reporting_activated = false; Raygun.detach(); Raygun.init(EventTrackingRepository.CONFIG.ERROR_REPORTING.API_KEY, {disableErrorTracking: true}); - this._detach_promise_rejection_handler(); } _enable_error_reporting() { @@ -371,6 +340,5 @@ z.tracking.EventTrackingRepository = class EventTrackingRepository { Raygun.withCustomData({electron_version: z.util.Environment.version(true)}); } Raygun.onBeforeSend(this._check_error_payload.bind(this)); - this._attach_promise_rejection_handler(); } }; diff --git a/package.json b/package.json index 8c55f5617db..1559892d625 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@bower_components/platform.js": "bestiejs/platform.js#1.3.5", "@bower_components/poster-image": "herrmannplatz/poster-image#1.1.1", "@bower_components/protobuf": "gregor/protobuf.js#32ada41d3c963bd5f43d7cdadced2d6d2ccd082a", - "@bower_components/raygun4js": "MindscapeHQ/raygun4js#2.9.4", + "@bower_components/raygun4js": "MindscapeHQ/raygun4js#2.10.0", "@bower_components/speakingurl": "pid/speakingurl#v14.0.1", "@bower_components/uint32": "fxa/uint32.js#0.2.1", "@bower_components/underscore": "jashkenas/underscore#1.8.3", diff --git a/test/unit_tests/tracking/EventTrackingRepositorySpec.js b/test/unit_tests/tracking/EventTrackingRepositorySpec.js index 7c828c99a95..1eee1336f28 100644 --- a/test/unit_tests/tracking/EventTrackingRepositorySpec.js +++ b/test/unit_tests/tracking/EventTrackingRepositorySpec.js @@ -138,45 +138,4 @@ describe('z.tracking.EventTrackingRepository', () => { expect(error_payload).toBe(false); }); }); - - describe('_attach_promise_rejection_handler', () => { - const error_description = 'Unit test error'; - - beforeAll(done => { - TestFactory.tracking_repository.init(true).then(() => { - TestFactory.tracking_repository._attach_promise_rejection_handler(); - done(); - }); - }); - - afterAll(() => TestFactory.tracking_repository._detach_promise_rejection_handler()); - - it('handles a Promise rejected with an Error that is uncaught', done => { - window.onerror = (error_message, file_name, line_number, column_number, error) => { - expect(error_message).toBe(error_description); - expect(error.message).toBe(error_description); - done(); - }; - - Promise.reject(new Error('Unit test error')); - }); - - it('handles a Promise rejected with a String that is uncaught', done => { - window.onerror = (error_message, file_name) => { - expect(error_message).toBe(error_description); - expect(file_name).toBeNull(); - done(); - }; - - /* eslint-disable prefer-promise-reject-errors */ - Promise.reject(error_description); - /* eslint-enable prefer-promise-reject-errors */ - }); - - it('ignores a rejected Promise that is caught', done => { - window.onerror = done.fail; - - Promise.reject(new Error(error_description)).catch(() => done()); - }); - }); }); diff --git a/yarn.lock b/yarn.lock index 912b3d5b0a2..c0252f92678 100644 --- a/yarn.lock +++ b/yarn.lock @@ -186,9 +186,9 @@ glob "^5.0.10" yargs "^3.10.0" -"@bower_components/raygun4js@MindscapeHQ/raygun4js#2.9.4": - version "2.9.4" - resolved "https://codeload.github.com/MindscapeHQ/raygun4js/tar.gz/91ab41003273ad2f007b408f3b13228626e8ab42" +"@bower_components/raygun4js@MindscapeHQ/raygun4js#2.10.0": + version "2.10.0" + resolved "https://codeload.github.com/MindscapeHQ/raygun4js/tar.gz/ef4b04ed0ff9a73f02e1bb32ba86c2bc5fba5a59" "@bower_components/speakingurl@pid/speakingurl#v14.0.1": version "14.0.1" From e00c28253f5ac62825bfd65ade1d5b7dff77efde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 21 Jun 2018 17:57:24 +0200 Subject: [PATCH 32/99] chore: Update @wireapp/core to version 3.4.2 (#3755) --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 1559892d625..edfa9577bc4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.4.1", + "@wireapp/core": "3.4.2", "@wireapp/react-ui-kit": "1.1.44", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index c0252f92678..c883c4217da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,9 +503,9 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.2.0.tgz#c89857b8f27fbdaf42e7ab15acf982c4366fcd33" +"@wireapp/api-client@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.2.1.tgz#216857317afd7a85d8ce5f7b0d87a221588bf925" dependencies: "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" @@ -523,12 +523,12 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.4.1": - version "3.4.1" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.4.1.tgz#6b092e42d3d4ecbd6b18c2a0df53eaeb4e41e668" +"@wireapp/core@3.4.2": + version "3.4.2" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.4.2.tgz#420e911317fd58edcee57d6478f53ec347de176a" dependencies: "@types/node" "10.3.4" - "@wireapp/api-client" "1.2.0" + "@wireapp/api-client" "1.2.1" "@wireapp/cryptobox" "8.4.8" "@wireapp/store-engine" "0.11.32" bazinga64 "5.2.4" From 52f12119de132b3a1ec81549076bdb1fa8dbdf2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 21 Jun 2018 18:18:18 +0200 Subject: [PATCH 33/99] chore: Update @wireapp/react-ui-kit to version 1.1.45 (#3756) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index edfa9577bc4..847bac04157 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.4.2", - "@wireapp/react-ui-kit": "1.1.44", + "@wireapp/react-ui-kit": "1.1.45", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index c883c4217da..9da2e5dfc0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,9 +571,9 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.1.44": - version "1.1.44" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.44.tgz#f0ee8056be2fe3f43f078e94ad1fc7381baaf68d" +"@wireapp/react-ui-kit@1.1.45": + version "1.1.45" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.45.tgz#c8cca731b76ebdf16bc0edb1cafa030a05cbc927" dependencies: bazinga64 "5.2.4" color "3.0.0" From df10dc71189e88d63b0c436ecf8b0607cf896abf Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Thu, 21 Jun 2018 18:29:24 +0200 Subject: [PATCH 34/99] feat: Increase group size limit to 256 (#3752) --- app/script/conversation/ConversationRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/script/conversation/ConversationRepository.js b/app/script/conversation/ConversationRepository.js index 1ed5098f9f2..a81dbc651f6 100644 --- a/app/script/conversation/ConversationRepository.js +++ b/app/script/conversation/ConversationRepository.js @@ -30,7 +30,7 @@ z.conversation.ConversationRepository = class ConversationRepository { EXTERNAL_MESSAGE_THRESHOLD: 200 * 1024, GROUP: { MAX_NAME_LENGTH: 64, - MAX_SIZE: 128, + MAX_SIZE: 256, }, STATE_EVENTS: [ z.event.Backend.CONVERSATION.ACCESS_UPDATE, From 83162aa0619797d46d623aee8cd17da80dfaeca2 Mon Sep 17 00:00:00 2001 From: Roger Sheen Date: Fri, 22 Jun 2018 09:59:20 +0200 Subject: [PATCH 35/99] feat: Clarify copy for group video calling limitation (#3757) --- app/script/localization/webapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/script/localization/webapp.js b/app/script/localization/webapp.js index 4c8ed4feb7b..6afd4f5f51a 100644 --- a/app/script/localization/webapp.js +++ b/app/script/localization/webapp.js @@ -379,7 +379,7 @@ z.string.groupCreationParticipantsActionSkip = 'Skip'; z.string.groupCreationParticipantsHeader = 'Add people'; z.string.groupCreationParticipantsHeaderWithCounter = 'Add people ({{number}})'; z.string.groupCreationParticipantsPlaceholder = 'Search by name'; -z.string.groupSizeInfo = 'Up to {{count}} people can join a group conversation. Video calls work in groups of 4 or less.'; +z.string.groupSizeInfo = 'Up to {{count}} people can join a group conversation. Video calls work with up to 3 other people and you.'; // Guest room z.string.guestRoomConversationName = 'Guest room'; From fe2cbbf2f8b77f00fb166266d7348a7c3e5bbb17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 10:03:38 +0200 Subject: [PATCH 36/99] chore: Update karma to version 2.0.4 (#3758) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 847bac04157..5fe7d8390eb 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "ip": "1.1.5", "jasmine-ajax": "3.4.0", "jasmine-core": "3.1.0", - "karma": "2.0.3", + "karma": "2.0.4", "karma-chrome-launcher": "2.2.0", "karma-coverage": "1.1.2", "karma-jasmine": "1.1.2", diff --git a/yarn.lock b/yarn.lock index 9da2e5dfc0d..5bafaf82cf1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5834,9 +5834,9 @@ karma-sourcemap-loader@0.3.7: dependencies: graceful-fs "^4.1.2" -karma@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.3.tgz#4d5e13d25f5a51331c5378b24c4984709c01120b" +karma@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.4.tgz#b399785f57e9bab1d3c4384db33fef4dec8ae349" dependencies: bluebird "^3.3.0" body-parser "^1.16.1" From e4654d1455e2c1280787768f69ad45fb805e03fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 10:09:42 +0200 Subject: [PATCH 37/99] chore: Update postcss-scss to version 1.0.6 (#3763) --- package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 5fe7d8390eb..8511bff385d 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "node-sass": "4.9.0", "postcss-cssnext": "3.1.0", "postcss-import": "11.1.0", - "postcss-scss": "1.0.5", + "postcss-scss": "1.0.6", "prettier": "1.13.5", "raf": "3.4.0", "react-addons-test-utils": "15.6.2", diff --git a/yarn.lock b/yarn.lock index 5bafaf82cf1..da16b8fa19e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8028,11 +8028,11 @@ postcss-sass@^0.3.0: gonzales-pe "4.2.3" postcss "6.0.22" -postcss-scss@1.0.5, postcss-scss@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-1.0.5.tgz#40a10cfd03766accf0a3cf8e65a8af887b2bf6c4" +postcss-scss@1.0.6, postcss-scss@^1.0.2: + version "1.0.6" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-1.0.6.tgz#ab903f3bb20161bc177896462293a53d4bff5f7a" dependencies: - postcss "^6.0.21" + postcss "^6.0.23" postcss-scss@^0.4.0: version "0.4.1" @@ -8110,7 +8110,7 @@ postcss-zindex@^2.0.1: postcss "^5.0.4" uniqs "^2.0.0" -postcss@6.0.22, postcss@^6.0.14, postcss@^6.0.16, postcss@^6.0.21, postcss@^6.0.22, postcss@^6.0.6, postcss@^6.0.8: +postcss@6.0.22: version "6.0.22" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.22.tgz#e23b78314905c3b90cbd61702121e7a78848f2a3" dependencies: @@ -8127,13 +8127,13 @@ postcss@^5.0.0, postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0. source-map "^0.5.6" supports-color "^3.2.3" -postcss@^6.0, postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.13, postcss@^6.0.5: - version "6.0.21" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.21.tgz#8265662694eddf9e9a5960db6da33c39e4cd069d" +postcss@^6.0, postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.13, postcss@^6.0.14, postcss@^6.0.16, postcss@^6.0.22, postcss@^6.0.23, postcss@^6.0.5, postcss@^6.0.6, postcss@^6.0.8: + version "6.0.23" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" dependencies: - chalk "^2.3.2" + chalk "^2.4.1" source-map "^0.6.1" - supports-color "^5.3.0" + supports-color "^5.4.0" prebuild-install@^2.3.0: version "2.3.0" From 1198148d2c69d96fe01e1b702ead8fe149877d2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 10:14:05 +0200 Subject: [PATCH 38/99] chore: Update @wireapp/core to version 3.5.1 (#3761) --- package.json | 2 +- yarn.lock | 58 ++++++++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 8511bff385d..1cca8f4f560 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.4.2", + "@wireapp/core": "3.5.1", "@wireapp/react-ui-kit": "1.1.45", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index da16b8fa19e..646d6fb8166 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,15 +503,15 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.2.1.tgz#216857317afd7a85d8ce5f7b0d87a221588bf925" +"@wireapp/api-client@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.1.tgz#4e36a0b743109163e28d518a40300e1599b68a2c" dependencies: "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" "@types/tough-cookie" "2.3.3" - "@wireapp/priority-queue" "0.1.47" - "@wireapp/store-engine" "0.11.32" + "@wireapp/priority-queue" "0.1.48" + "@wireapp/store-engine" "0.11.33" axios "0.18.0" html5-websocket "2.0.3" logdown "3.2.3" @@ -523,29 +523,29 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.4.2": - version "3.4.2" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.4.2.tgz#420e911317fd58edcee57d6478f53ec347de176a" +"@wireapp/core@3.5.1": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.1.tgz#4495efaf316be8802da4daf8a6f38d38f116bc58" dependencies: "@types/node" "10.3.4" - "@wireapp/api-client" "1.2.1" - "@wireapp/cryptobox" "8.4.8" - "@wireapp/store-engine" "0.11.32" - bazinga64 "5.2.4" + "@wireapp/api-client" "1.3.1" + "@wireapp/cryptobox" "8.5.1" + "@wireapp/store-engine" "0.11.33" + bazinga64 "5.2.5" logdown "3.2.3" protobufjs "6.8.6" pure-uuid "1.5.2" -"@wireapp/cryptobox@8.4.8": - version "8.4.8" - resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.4.8.tgz#e6c964c819264b91d88bc40eaa909b17ca130ebc" +"@wireapp/cryptobox@8.5.1": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.5.1.tgz#91d141da29b8cb21a618e3405eade01daff6bfdd" dependencies: "@types/fs-extra" "5.0.3" "@types/node" "10.3.4" "@wireapp/lru-cache" "2.1.28" - "@wireapp/priority-queue" "0.1.47" - "@wireapp/proteus" "7.1.63" - "@wireapp/store-engine" "0.11.32" + "@wireapp/priority-queue" "0.1.48" + "@wireapp/proteus" "7.2.0" + "@wireapp/store-engine" "0.11.33" dexie "2.0.4" fs-extra "6.0.1" @@ -553,16 +553,16 @@ version "2.1.28" resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.28.tgz#6cb7aea2b9f972c19194961eebdaea97df577da1" -"@wireapp/priority-queue@0.1.47": - version "0.1.47" - resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.47.tgz#7dbe0c54f5fb669c1753163a3d3c06664e422d26" +"@wireapp/priority-queue@0.1.48": + version "0.1.48" + resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.48.tgz#b4f4b79c99a0c727465610a8100a0eb98e917f1d" dependencies: "@types/node" "10.3.4" pure-uuid "1.5.2" -"@wireapp/proteus@7.1.63": - version "7.1.63" - resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.1.63.tgz#0387c12deb8922a71aa390450412784858407ad5" +"@wireapp/proteus@7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.2.0.tgz#4a9ba2e196c2936692f76ba1f32b86130ca5a32a" dependencies: "@types/chai" "4.1.4" "@types/ed2curve" "0.2.2" @@ -583,9 +583,9 @@ styled-components "3.3.2" styled-normalize "4.0.0" -"@wireapp/store-engine@0.11.32": - version "0.11.32" - resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.32.tgz#bdbc14130e6dd0da33aa7c16b61b502c3b4ac033" +"@wireapp/store-engine@0.11.33": + version "0.11.33" + resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.33.tgz#379d024a527191ad4e39c5baf0b45bbfb26c170f" dependencies: "@types/filesystem" "0.0.28" "@types/node" "10.3.4" @@ -1694,6 +1694,10 @@ bazinga64@5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.4.tgz#45b0403cdfaa3bf9406ff3eee596db59b4c1c9e3" +bazinga64@5.2.5: + version "5.2.5" + resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.5.tgz#f77ce58926e28b6a74a622db3a353730e02f0e1e" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" From 7f92487aa6218df882baff353c1db2a39a9857ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 10:23:02 +0200 Subject: [PATCH 39/99] chore: Update @wireapp/react-ui-kit to version 1.2.1 (#3762) --- package.json | 2 +- yarn.lock | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 1cca8f4f560..b0822904f87 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.5.1", - "@wireapp/react-ui-kit": "1.1.45", + "@wireapp/react-ui-kit": "1.2.1", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index 646d6fb8166..13ffaaeb0e2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,16 +571,16 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.1.45": - version "1.1.45" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.1.45.tgz#c8cca731b76ebdf16bc0edb1cafa030a05cbc927" +"@wireapp/react-ui-kit@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.1.tgz#6948ca453cdf322463ca55dbb17fd70cc1cbf319" dependencies: - bazinga64 "5.2.4" + bazinga64 "5.2.5" color "3.0.0" react "16.4.1" react-dom "16.4.1" recompose "0.27.1" - styled-components "3.3.2" + styled-components "3.3.3" styled-normalize "4.0.0" "@wireapp/store-engine@0.11.33": @@ -1690,10 +1690,6 @@ batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" -bazinga64@5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.4.tgz#45b0403cdfaa3bf9406ff3eee596db59b4c1c9e3" - bazinga64@5.2.5: version "5.2.5" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.5.tgz#f77ce58926e28b6a74a622db3a353730e02f0e1e" @@ -9912,9 +9908,9 @@ style-search@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" -styled-components@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-3.3.2.tgz#087b96830ee3d60d9a8b5ef17c132b4f29cc71df" +styled-components@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-3.3.3.tgz#09e702055ab11f7a8eab8229b1c0d0b855095686" dependencies: buffer "^5.0.3" css-to-react-native "^2.0.3" From f4094205a1bba08a574ce9db8b941f5ab9aeccc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 12:21:54 +0200 Subject: [PATCH 40/99] chore: Update @wireapp/react-ui-kit to version 1.2.2 (#3766) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b0822904f87..1bd3854c5f9 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.5.1", - "@wireapp/react-ui-kit": "1.2.1", + "@wireapp/react-ui-kit": "1.2.2", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index 13ffaaeb0e2..19f5c168fc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,9 +571,9 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.1.tgz#6948ca453cdf322463ca55dbb17fd70cc1cbf319" +"@wireapp/react-ui-kit@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.2.tgz#ca243572c90544ab2ff108eb77496a823dfc8d1f" dependencies: bazinga64 "5.2.5" color "3.0.0" From 83b56b12b55847c24982c81b4fc792ae2a5a517d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 12:32:24 +0200 Subject: [PATCH 41/99] chore: Update @wireapp/core to version 3.5.2 (#3767) --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 1bd3854c5f9..f224db5eb0a 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.5.1", + "@wireapp/core": "3.5.2", "@wireapp/react-ui-kit": "1.2.2", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 19f5c168fc1..6e4651da607 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,9 +503,9 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.1.tgz#4e36a0b743109163e28d518a40300e1599b68a2c" +"@wireapp/api-client@1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.2.tgz#bcc8c6d586d0a7755dde96318425544b4d7d0b34" dependencies: "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" @@ -523,12 +523,12 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.1.tgz#4495efaf316be8802da4daf8a6f38d38f116bc58" +"@wireapp/core@3.5.2": + version "3.5.2" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.2.tgz#6100237cb69f060af01ca19166b85b3922144fec" dependencies: "@types/node" "10.3.4" - "@wireapp/api-client" "1.3.1" + "@wireapp/api-client" "1.3.2" "@wireapp/cryptobox" "8.5.1" "@wireapp/store-engine" "0.11.33" bazinga64 "5.2.5" From bd50a80156e8ae95296e0bd4291601d88e706c9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 13:07:38 +0200 Subject: [PATCH 42/99] chore: Update @wireapp/react-ui-kit to version 1.2.3 (#3768) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f224db5eb0a..339b0dd3c8f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.5.2", - "@wireapp/react-ui-kit": "1.2.2", + "@wireapp/react-ui-kit": "1.2.3", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index 6e4651da607..635e2c307fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,9 +571,9 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.2.tgz#ca243572c90544ab2ff108eb77496a823dfc8d1f" +"@wireapp/react-ui-kit@1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.3.tgz#6ae91977a77073d9ac6918e479c79c2efbedfaee" dependencies: bazinga64 "5.2.5" color "3.0.0" From 93a6ef67c8e9dbe288c674dcc3fd5d7c0852f9cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Fri, 22 Jun 2018 13:42:16 +0200 Subject: [PATCH 43/99] chore: Update @wireapp/core to version 3.5.3 (#3769) --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 339b0dd3c8f..aeb7f09dad0 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.5.2", + "@wireapp/core": "3.5.3", "@wireapp/react-ui-kit": "1.2.3", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 635e2c307fa..f43808e9f8e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,9 +503,9 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.2.tgz#bcc8c6d586d0a7755dde96318425544b4d7d0b34" +"@wireapp/api-client@1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.3.tgz#e8a961c87d98107084c7e23d4a599fffbb6ce9ed" dependencies: "@types/node" "10.3.4" "@types/spark-md5" "3.0.0" @@ -523,12 +523,12 @@ version "3.0.50" resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" -"@wireapp/core@3.5.2": - version "3.5.2" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.2.tgz#6100237cb69f060af01ca19166b85b3922144fec" +"@wireapp/core@3.5.3": + version "3.5.3" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.3.tgz#f82c69e7a259eb70f643d05464ce97e2dd965b24" dependencies: "@types/node" "10.3.4" - "@wireapp/api-client" "1.3.2" + "@wireapp/api-client" "1.3.3" "@wireapp/cryptobox" "8.5.1" "@wireapp/store-engine" "0.11.33" bazinga64 "5.2.5" From 98d86c11e8647ea37b72a6b0dbc01699eda5069e Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Fri, 22 Jun 2018 15:08:36 +0200 Subject: [PATCH 44/99] fix: Rely on max group size when creation fails (#3773) --- app/script/conversation/ConversationRepository.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/script/conversation/ConversationRepository.js b/app/script/conversation/ConversationRepository.js index a81dbc651f6..6f842a738ff 100644 --- a/app/script/conversation/ConversationRepository.js +++ b/app/script/conversation/ConversationRepository.js @@ -1494,7 +1494,7 @@ z.conversation.ConversationRepository = class ConversationRepository { } } - _handleTooManyMembersError(participants = 128) { + _handleTooManyMembersError(participants = ConversationRepository.CONFIG.GROUP.MAX_SIZE) { const openSpots = ConversationRepository.CONFIG.GROUP.MAX_SIZE - participants; const substitutions = {number1: ConversationRepository.CONFIG.GROUP.MAX_SIZE, number2: Math.max(0, openSpots)}; From 8994fa250b1df716e13c0ba4c2f683e10cc808f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 11:16:38 +0200 Subject: [PATCH 45/99] chore: Update eslint to version 5.0.0 (#3782) --- package.json | 2 +- yarn.lock | 213 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 126 insertions(+), 89 deletions(-) diff --git a/package.json b/package.json index aeb7f09dad0..9722f8f8ebe 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "enzyme": "3.3.0", "enzyme-adapter-react-16": "1.1.1", "enzyme-to-json": "3.3.4", - "eslint": "4.19.1", + "eslint": "5.0.0", "eslint-config-prettier": "2.9.0", "eslint-plugin-babel": "5.1.0", "eslint-plugin-jsdoc": "3.7.1", diff --git a/yarn.lock b/yarn.lock index f43808e9f8e..a05f6e4ce15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -621,20 +621,20 @@ acorn-dynamic-import@^3.0.0: dependencies: acorn "^5.0.0" -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" +acorn-jsx@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + acorn "^5.0.3" -acorn@^5.0.0, acorn@^5.5.0: +acorn@^5.0.0: version "5.5.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" +acorn@^5.0.3, acorn@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" + acorn@^5.6.2: version "5.6.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.6.2.tgz#b1da1d7be2ac1b4a327fb9eab851702c5045b4e7" @@ -653,10 +653,6 @@ agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0: dependencies: es6-promisify "^5.0.0" -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - ajv-keywords@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" @@ -672,7 +668,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: +ajv@^5.1.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: @@ -699,6 +695,15 @@ ajv@^6.1.0: json-schema-traverse "^0.3.0" uri-js "^3.0.2" +ajv@^6.5.0: + version "6.5.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.1.tgz#88ebc1263c7133937d108b80c5572e64e1d9322d" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.1" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -1047,7 +1052,7 @@ axios@^0.15.3: dependencies: follow-redirects "1.0.0" -babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: +babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -2567,7 +2572,7 @@ concat-stream@^1.4.1: readable-stream "^2.2.2" typedarray "^0.0.6" -concat-stream@^1.5.0, concat-stream@^1.6.0: +concat-stream@^1.5.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: @@ -2762,7 +2767,7 @@ cross-spawn@^3.0.0: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^5.0.1, cross-spawn@^5.1.0: +cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -3459,6 +3464,16 @@ error@^7.0.0: string-template "~0.2.1" xtend "~4.0.0" +es-abstract@^1.10.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + es-abstract@^1.6.1, es-abstract@^1.7.0: version "1.10.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" @@ -3590,59 +3605,66 @@ eslint-scope@^3.7.1, eslint-scope@~3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@4.19.1: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" +eslint@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.0.0.tgz#3576704f7377aca072da69c00862277c5fe57153" dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" + ajv "^6.5.0" + babel-code-frame "^6.26.0" chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" + cross-spawn "^6.0.5" debug "^3.1.0" doctrine "^2.1.0" - eslint-scope "^3.7.1" + eslint-scope "^4.0.0" eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" + espree "^4.0.0" + esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^2.0.0" functional-red-black-tree "^1.0.1" glob "^7.1.2" - globals "^11.0.1" + globals "^11.5.0" ignore "^3.3.3" imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" + inquirer "^5.2.0" + is-resolvable "^1.1.0" + js-yaml "^3.11.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" + lodash "^4.17.5" + minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" pluralize "^7.0.0" progress "^2.0.0" - regexpp "^1.0.1" + regexpp "^1.1.0" require-uncached "^1.0.3" - semver "^5.3.0" + semver "^5.5.0" + string.prototype.matchall "^2.0.0" strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" + strip-json-comments "^2.0.1" + table "^4.0.3" + text-table "^0.2.0" -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" +espree@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" + acorn "^5.6.0" + acorn-jsx "^4.1.1" esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" @@ -3656,9 +3678,9 @@ esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" -esquery@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" dependencies: estraverse "^4.0.0" @@ -3842,9 +3864,9 @@ extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" -external-editor@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" +external-editor@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" dependencies: chardet "^0.4.0" iconv-lite "^0.4.17" @@ -4405,14 +4427,14 @@ global@^4.3.0: min-document "^2.19.0" process "~0.5.1" -globals@^11.0.1: - version "11.3.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" - globals@^11.1.0: version "11.4.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" +globals@^11.5.0: + version "11.7.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -5137,21 +5159,20 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -inquirer@^3.0.6: - version "3.3.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" +inquirer@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.0" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^2.0.4" + external-editor "^2.1.0" figures "^2.0.0" lodash "^4.3.0" mute-stream "0.0.7" run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" + rxjs "^5.5.2" string-width "^2.1.0" strip-ansi "^4.0.0" through "^2.3.6" @@ -5517,7 +5538,7 @@ is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" -is-resolvable@^1.0.0: +is-resolvable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -5676,13 +5697,20 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.9.0, js-yaml@^3.9.1: +js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.9.0: version "3.11.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" dependencies: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + js-yaml@~3.5.2: version "3.5.5" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.5.5.tgz#0377c38017cabc7322b0d1fbcd25a491641f2fbe" @@ -5725,6 +5753,10 @@ json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -8845,9 +8877,15 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43" +regexp.prototype.flags@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz#6b30724e306a27833eeb171b66ac8890ba37e41c" + dependencies: + define-properties "^1.1.2" + +regexpp@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" regexpu-core@^2.0.0: version "2.0.0" @@ -9185,20 +9223,16 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - rx@2.3.24: version "2.3.24" resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" +rxjs@^5.5.2: + version "5.5.11" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.11.tgz#f733027ca43e3bec6b994473be4ab98ad43ced87" + dependencies: + symbol-observable "1.0.1" + rxjs@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.1.0.tgz#833447de4e4f6427b9cec3e5eb9f56415cd28315" @@ -9823,6 +9857,16 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string.prototype.matchall@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz#2af8fe3d2d6dc53ca2a59bd376b089c3c152b3c8" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.10.0" + function-bind "^1.1.1" + has-symbols "^1.0.0" + regexp.prototype.flags "^1.2.0" + string_decoder@0.10, string_decoder@^0.10.25, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -9900,7 +9944,7 @@ strip-indent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -10120,6 +10164,10 @@ svgo@^0.7.0: sax "~1.2.1" whet.extend "~0.9.9" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + symbol-observable@^1.0.4, symbol-observable@^1.1.0, symbol-observable@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" @@ -10130,18 +10178,7 @@ synesthesia@^1.0.1: dependencies: css-color-names "0.0.3" -table@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" - -table@^4.0.1: +table@^4.0.1, table@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" dependencies: @@ -10211,7 +10248,7 @@ text-encoding@^0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" -text-table@^0.2.0, text-table@~0.2.0: +text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" From 60a81aa7582b429267a3b12d7fd062993a4161ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 11:23:35 +0200 Subject: [PATCH 46/99] chore: Update sinon to version 6.0.1 (#3785) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9722f8f8ebe..b47bf435d09 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "redux-devtools-extension": "2.13.5", "redux-mock-store": "1.5.3", "request": "2.87.0", - "sinon": "6.0.0", + "sinon": "6.0.1", "stylelint": "9.3.0", "stylelint-config-idiomatic-order": "5.0.0", "stylelint-config-prettier": "3.3.0", diff --git a/yarn.lock b/yarn.lock index a05f6e4ce15..af0f4dce28c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9446,9 +9446,9 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" -sinon@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.0.0.tgz#f26627e4830dc34279661474da2c9e784f166215" +sinon@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.0.1.tgz#4247b97dd8fecbe1e19f8b816a5e7eed3993bcfe" dependencies: "@sinonjs/formatio" "^2.0.0" diff "^3.5.0" From 0b58ed625b98f57476696e234d3a6ab1788e02d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 11:29:30 +0200 Subject: [PATCH 47/99] chore: Update babel-eslint to version 8.2.5 (#3783) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b47bf435d09..fce0c7fcba2 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "devDependencies": { "autoprefixer": "8.6.3", "babel-core": "6.26.3", - "babel-eslint": "8.2.3", + "babel-eslint": "8.2.5", "babel-loader": "7.1.4", "babel-plugin-transform-class-properties": "6.24.1", "babel-plugin-transform-object-rest-spread": "6.26.0", diff --git a/yarn.lock b/yarn.lock index af0f4dce28c..bba1293825a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1084,9 +1084,9 @@ babel-core@6.26.3, babel-core@^6.26.0: slash "^1.0.0" source-map "^0.5.7" -babel-eslint@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf" +babel-eslint@8.2.5: + version "8.2.5" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.5.tgz#dc2331c259d36782aa189da510c43dedd5adc7a3" dependencies: "@babel/code-frame" "7.0.0-beta.44" "@babel/traverse" "7.0.0-beta.44" From b66e727f9df532759561a4a6f5344fd0d0221c22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 11:33:30 +0200 Subject: [PATCH 48/99] chore: Update eslint-plugin-prettier to version 2.6.1 (#3781) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fce0c7fcba2..95000b7dd11 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "eslint-config-prettier": "2.9.0", "eslint-plugin-babel": "5.1.0", "eslint-plugin-jsdoc": "3.7.1", - "eslint-plugin-prettier": "2.6.0", + "eslint-plugin-prettier": "2.6.1", "eslint-plugin-react": "7.7.0", "grunt": "1.0.3", "grunt-aws-s3": "2.0.0", diff --git a/yarn.lock b/yarn.lock index bba1293825a..67e7bc0b793 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3578,9 +3578,9 @@ eslint-plugin-jsdoc@3.7.1: jsdoctypeparser "^2.0.0-alpha-8" lodash "^4.17.4" -eslint-plugin-prettier@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" +eslint-plugin-prettier@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.1.tgz#de902b4a66b7bca24296429a59a1cc04020ccbbd" dependencies: fast-diff "^1.1.1" jest-docblock "^21.0.0" From 5b7b03e4b060f03b241d07b3f704cd5473be7d2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 11:37:58 +0200 Subject: [PATCH 49/99] chore: Update webpack to version 4.12.1 (#3784) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 95000b7dd11..9a72fbd24f0 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "stylelint-config-prettier": "3.3.0", "uglify-js": "3.4.1", "uglifyjs-webpack-plugin": "1.2.6", - "webpack": "4.12.0", + "webpack": "4.12.1", "webpack-cli": "3.0.8", "webpack-dev-server": "3.1.4" }, diff --git a/yarn.lock b/yarn.lock index 67e7bc0b793..4f3aa6330d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10891,9 +10891,9 @@ webpack-sources@^1.0.1, webpack-sources@^1.1.0: source-list-map "^2.0.0" source-map "~0.6.1" -webpack@4.12.0: - version "4.12.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.12.0.tgz#14758e035ae69747f68dd0edf3c5a572a82bdee9" +webpack@4.12.1: + version "4.12.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.12.1.tgz#9108078c67fdd72c2609cea22af87d7aed2acb08" dependencies: "@webassemblyjs/ast" "1.5.12" "@webassemblyjs/helper-module-context" "1.5.12" From f5c6972829b73a4b0c6e44754bf2efaf34b69508 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 11:42:52 +0200 Subject: [PATCH 50/99] chore: Update @wireapp/core to version 3.5.6 (#3788) --- package.json | 2 +- yarn.lock | 102 ++++++++++++++++++++++++++------------------------- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index 9a72fbd24f0..f967c6eba09 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.5.3", + "@wireapp/core": "3.5.6", "@wireapp/react-ui-kit": "1.2.3", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index 4f3aa6330d1..6c5a63c8d28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -343,9 +343,9 @@ version "10.1.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.2.tgz#1b928a0baa408fc8ae3ac012cc81375addc147c6" -"@types/node@10.3.4": - version "10.3.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.4.tgz#c74e8aec19e555df44609b8057311052a2c84d9e" +"@types/node@10.3.5": + version "10.3.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.5.tgz#8423cdf6e6fb83433e489900d7600d3b61c8260c" "@types/node@^6.0.46": version "6.0.90" @@ -503,15 +503,15 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.3.tgz#e8a961c87d98107084c7e23d4a599fffbb6ce9ed" +"@wireapp/api-client@1.3.6": + version "1.3.6" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.3.6.tgz#adff321d6c6efee72ee10a0e162b83151850ed6d" dependencies: - "@types/node" "10.3.4" + "@types/node" "10.3.5" "@types/spark-md5" "3.0.0" "@types/tough-cookie" "2.3.3" - "@wireapp/priority-queue" "0.1.48" - "@wireapp/store-engine" "0.11.33" + "@wireapp/priority-queue" "0.1.49" + "@wireapp/store-engine" "0.11.34" axios "0.18.0" html5-websocket "2.0.3" logdown "3.2.3" @@ -519,55 +519,55 @@ spark-md5 "3.0.0" tough-cookie "2.4.2" -"@wireapp/cbor@3.0.50": - version "3.0.50" - resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.50.tgz#2824fe60b6a0cd90aefd5df1cbad6f16a7772896" +"@wireapp/cbor@3.0.51": + version "3.0.51" + resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.51.tgz#293e21c00838086a9d8128fe4ac3dba499a862f4" -"@wireapp/core@3.5.3": - version "3.5.3" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.3.tgz#f82c69e7a259eb70f643d05464ce97e2dd965b24" +"@wireapp/core@3.5.6": + version "3.5.6" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.5.6.tgz#7ab38ea1445293c35c7eece74e415b8d20f9a5b3" dependencies: - "@types/node" "10.3.4" - "@wireapp/api-client" "1.3.3" - "@wireapp/cryptobox" "8.5.1" - "@wireapp/store-engine" "0.11.33" - bazinga64 "5.2.5" + "@types/node" "10.3.5" + "@wireapp/api-client" "1.3.6" + "@wireapp/cryptobox" "8.5.2" + "@wireapp/store-engine" "0.11.34" + bazinga64 "5.2.6" logdown "3.2.3" protobufjs "6.8.6" - pure-uuid "1.5.2" + pure-uuid "1.5.3" -"@wireapp/cryptobox@8.5.1": - version "8.5.1" - resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.5.1.tgz#91d141da29b8cb21a618e3405eade01daff6bfdd" +"@wireapp/cryptobox@8.5.2": + version "8.5.2" + resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.5.2.tgz#b163a79e47fc4510d7c1ac8354341116f60b2252" dependencies: "@types/fs-extra" "5.0.3" - "@types/node" "10.3.4" - "@wireapp/lru-cache" "2.1.28" - "@wireapp/priority-queue" "0.1.48" - "@wireapp/proteus" "7.2.0" - "@wireapp/store-engine" "0.11.33" + "@types/node" "10.3.5" + "@wireapp/lru-cache" "2.1.29" + "@wireapp/priority-queue" "0.1.49" + "@wireapp/proteus" "7.2.1" + "@wireapp/store-engine" "0.11.34" dexie "2.0.4" fs-extra "6.0.1" -"@wireapp/lru-cache@2.1.28": - version "2.1.28" - resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.28.tgz#6cb7aea2b9f972c19194961eebdaea97df577da1" +"@wireapp/lru-cache@2.1.29": + version "2.1.29" + resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.29.tgz#812371aeefc438e8625b633834c73162539fcf30" -"@wireapp/priority-queue@0.1.48": - version "0.1.48" - resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.48.tgz#b4f4b79c99a0c727465610a8100a0eb98e917f1d" +"@wireapp/priority-queue@0.1.49": + version "0.1.49" + resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.49.tgz#b355dd1c1ce5c1fd1e48a0100c2ed812173b83af" dependencies: - "@types/node" "10.3.4" - pure-uuid "1.5.2" + "@types/node" "10.3.5" + pure-uuid "1.5.3" -"@wireapp/proteus@7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.2.0.tgz#4a9ba2e196c2936692f76ba1f32b86130ca5a32a" +"@wireapp/proteus@7.2.1": + version "7.2.1" + resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.2.1.tgz#1126b0a113e581498d23d8dad8af173449de35e1" dependencies: "@types/chai" "4.1.4" "@types/ed2curve" "0.2.2" - "@types/node" "10.3.4" - "@wireapp/cbor" "3.0.50" + "@types/node" "10.3.5" + "@wireapp/cbor" "3.0.51" ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" @@ -583,12 +583,12 @@ styled-components "3.3.3" styled-normalize "4.0.0" -"@wireapp/store-engine@0.11.33": - version "0.11.33" - resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.33.tgz#379d024a527191ad4e39c5baf0b45bbfb26c170f" +"@wireapp/store-engine@0.11.34": + version "0.11.34" + resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.34.tgz#ae3c37ce5d218d227143c0696c9f197130711d18" dependencies: "@types/filesystem" "0.0.28" - "@types/node" "10.3.4" + "@types/node" "10.3.5" bro-fs "0.4.0" dexie "2.0.4" fs-extra "6.0.1" @@ -1699,6 +1699,10 @@ bazinga64@5.2.5: version "5.2.5" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.5.tgz#f77ce58926e28b6a74a622db3a353730e02f0e1e" +bazinga64@5.2.6: + version "5.2.6" + resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.6.tgz#a8c374fd5e0ae9d8cbb31ebe77fa797ef1b0d7ed" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" @@ -8388,9 +8392,9 @@ punycode@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" -pure-uuid@1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/pure-uuid/-/pure-uuid-1.5.2.tgz#09fc63321173db3c524bc61a8bc4c0ad580138b9" +pure-uuid@1.5.3: + version "1.5.3" + resolved "https://registry.yarnpkg.com/pure-uuid/-/pure-uuid-1.5.3.tgz#cafee7e95b5ff96d7fb737346214967e009d5bce" q@^1.1.2: version "1.5.1" From 14aaf4e21e5d34635537b6402a899f5612609159 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Jun 2018 12:07:39 +0200 Subject: [PATCH 51/99] chore: Update @wireapp/react-ui-kit to version 1.2.6 (#3787) --- package.json | 2 +- yarn.lock | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index f967c6eba09..54d2ccfc571 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.5.6", - "@wireapp/react-ui-kit": "1.2.3", + "@wireapp/react-ui-kit": "1.2.6", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index 6c5a63c8d28..f306db40947 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,11 +571,11 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.2.3": - version "1.2.3" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.3.tgz#6ae91977a77073d9ac6918e479c79c2efbedfaee" +"@wireapp/react-ui-kit@1.2.6": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.2.6.tgz#f4e1ea04b073c77b36c7a97532bf6de92c96c808" dependencies: - bazinga64 "5.2.5" + bazinga64 "5.2.6" color "3.0.0" react "16.4.1" react-dom "16.4.1" @@ -1695,10 +1695,6 @@ batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" -bazinga64@5.2.5: - version "5.2.5" - resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.5.tgz#f77ce58926e28b6a74a622db3a353730e02f0e1e" - bazinga64@5.2.6: version "5.2.6" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.6.tgz#a8c374fd5e0ae9d8cbb31ebe77fa797ef1b0d7ed" From 8ae6f343fdd9d71216acabcdbfbf541f7198b174 Mon Sep 17 00:00:00 2001 From: AndyLnd Date: Mon, 25 Jun 2018 15:01:37 +0200 Subject: [PATCH 52/99] feat: new icon in preferences, svg icons demo, clean out css (#3776) --- app/demo/demo.html | 19 +++++- app/demo/template/icons.htm | 33 ++++++++++ app/page/template/content/preferences-av.htm | 2 +- app/style/content/preferences.less | 4 ++ app/style/fonts/zeta-neue.css | 63 -------------------- 5 files changed, 54 insertions(+), 67 deletions(-) create mode 100644 app/demo/template/icons.htm diff --git a/app/demo/demo.html b/app/demo/demo.html index 8f080cee0e1..5fe5da0e5e6 100644 --- a/app/demo/demo.html +++ b/app/demo/demo.html @@ -106,10 +106,22 @@ .box-list-dark { background: #222; } + + #icons * { + font-size: 0; + margin: 8px; + } + + #icons *:not(.override-color) svg path{ + fill: currentColor; + } - + + #include('../../page/template/#dest/vendor.htm') + #include('../../page/template/#dest/component.htm') + #include('microbar.htm')

Colors

#include('colors.htm') @@ -125,9 +137,9 @@

Avatars

#include('avatars.htm')

Dots

#include('dots.htm') +

SVG Icons

+ #include('icons.htm') - #include('../../page/template/#dest/vendor.htm') - #include('../../page/template/#dest/component.htm') diff --git a/app/demo/template/icons.htm b/app/demo/template/icons.htm new file mode 100644 index 00000000000..338a5dbfb59 --- /dev/null +++ b/app/demo/template/icons.htm @@ -0,0 +1,33 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/app/page/template/content/preferences-av.htm b/app/page/template/content/preferences-av.htm index d5af6dd860d..497c968390e 100644 --- a/app/page/template/content/preferences-av.htm +++ b/app/page/template/content/preferences-av.htm @@ -64,7 +64,7 @@
-
+
-
@@ -95,13 +81,19 @@ - + + +
- - + + + + + +

diff --git a/app/page/template/content/conversation/message-list.htm b/app/page/template/content/conversation/message-list.htm index 7756955cf44..d99e85319fe 100644 --- a/app/page/template/content/conversation/message-list.htm +++ b/app/page/template/content/conversation/message-list.htm @@ -4,8 +4,7 @@ data-bind="css: {'flex-center': center_messages}, foreach: {data: conversation().messages_visible, as: 'message'}">
diff --git a/app/page/template/panel/conversation-details.htm b/app/page/template/panel/conversation-details.htm index d459cf24417..d1492db8dee 100644 --- a/app/page/template/panel/conversation-details.htm +++ b/app/page/template/panel/conversation-details.htm @@ -51,7 +51,7 @@
-
+
@@ -79,6 +79,16 @@
+ +
+
+ +
+
+ +
+
+
diff --git a/app/page/template/panel/guest-options.htm b/app/page/template/panel/guest-options.htm index 5257feb987c..a684f3d64c2 100644 --- a/app/page/template/panel/guest-options.htm +++ b/app/page/template/panel/guest-options.htm @@ -11,7 +11,7 @@ -
+
diff --git a/app/page/template/panel/participant-devices.htm b/app/page/template/panel/participant-devices.htm index bfd6219094c..b36151cf798 100644 --- a/app/page/template/panel/participant-devices.htm +++ b/app/page/template/panel/participant-devices.htm @@ -23,7 +23,7 @@
-
+
@@ -44,7 +44,7 @@
-
+
@@ -52,7 +52,7 @@
-
+
diff --git a/app/page/template/panel/timed-messages.htm b/app/page/template/panel/timed-messages.htm new file mode 100644 index 00000000000..42f52830257 --- /dev/null +++ b/app/page/template/panel/timed-messages.htm @@ -0,0 +1,28 @@ +
+ +
+ +
+ +
+
+
+
+
+ + + +
+ +
+
+ + + +
+ +
+
+
+ +
diff --git a/app/page/template/partials/template-message.htm b/app/page/template/partials/template-message.htm index 54d8ffb3a47..44a96162a76 100644 --- a/app/page/template/partials/template-message.htm +++ b/app/page/template/partials/template-message.htm @@ -85,7 +85,11 @@
-
+ +
+ + + @@ -156,9 +160,6 @@ - - -
@@ -272,18 +273,12 @@
-
+
- - - - - - - +
@@ -291,7 +286,7 @@ + @@ -16,7 +17,6 @@ - diff --git a/app/script/assets/AssetMetaDataBuilder.js b/app/script/assets/AssetMetaDataBuilder.js index e5ee2659ca0..3488a5aa0cf 100644 --- a/app/script/assets/AssetMetaDataBuilder.js +++ b/app/script/assets/AssetMetaDataBuilder.js @@ -55,7 +55,8 @@ z.assets.AssetMetaDataBuilder = (() => { return audioContext.decodeAudioData(buffer); }) .then(audioBuffer => { - return new z.proto.Asset.AudioMetaData(audioBuffer.duration * 1000, _normaliseLoudness(audioBuffer)); + const durationInMillis = audioBuffer.duration * z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; + return new z.proto.Asset.AudioMetaData(durationInMillis, _normaliseLoudness(audioBuffer)); }); }; diff --git a/app/script/auth/AuthRepository.js b/app/script/auth/AuthRepository.js index 49c2477b443..f20bdde1190 100644 --- a/app/script/auth/AuthRepository.js +++ b/app/script/auth/AuthRepository.js @@ -25,7 +25,7 @@ window.z.auth = z.auth || {}; z.auth.AuthRepository = class AuthRepository { static get CONFIG() { return { - REFRESH_THRESHOLD: 60 * 1000, + REFRESH_THRESHOLD: z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE, }; } @@ -200,7 +200,7 @@ z.auth.AuthRepository = class AuthRepository { * @returns {Object} Access token data */ saveAccessToken(accessTokenData) { - const expiresInMillis = 1000 * accessTokenData.expires_in; + const expiresInMillis = accessTokenData.expires_in * z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; const expirationTimestamp = Date.now() + expiresInMillis; z.util.StorageUtil.setValue( diff --git a/app/script/auth/AuthService.js b/app/script/auth/AuthService.js index a91485f3b88..a0c873d3325 100644 --- a/app/script/auth/AuthService.js +++ b/app/script/auth/AuthService.js @@ -26,7 +26,7 @@ z.auth.AuthService = class AuthService { static get CONFIG() { return { POST_ACCESS_RETRY_LIMIT: 10, - POST_ACCESS_RETRY_TIMEOUT: 500, + POST_ACCESS_RETRY_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 0.5, URL_ACCESS: '/access', URL_ACTIVATE: '/activate', URL_COOKIES: '/cookies', diff --git a/app/script/auth/component/ClientList.jsx b/app/script/auth/component/ClientList.jsx index f8e28c7e1df..4f18d97755b 100644 --- a/app/script/auth/component/ClientList.jsx +++ b/app/script/auth/component/ClientList.jsx @@ -55,7 +55,8 @@ class ClientList extends React.Component { removeClient = (clientId, password) => { this.setState({showLoading: true}); - this.loadingTimeout = window.setTimeout(this.resetLoadingSpinner.bind(this), 1000); + const timeout = z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; + this.loadingTimeout = window.setTimeout(this.resetLoadingSpinner.bind(this), timeout); return Promise.resolve() .then(() => this.props.doRemoveClient(clientId, password)) .then(() => { diff --git a/app/script/calling/CallingRepository.js b/app/script/calling/CallingRepository.js index 92d39a79370..7465883d210 100644 --- a/app/script/calling/CallingRepository.js +++ b/app/script/calling/CallingRepository.js @@ -1025,7 +1025,7 @@ z.calling.CallingRepository = class CallingRepository { action: () => { const terminationReason = z.calling.enum.TERMINATION_REASON.CONCURRENT_CALL; amplify.publish(z.event.WebApp.CALL.STATE.LEAVE, ongoingCallId, terminationReason); - window.setTimeout(resolve, 1000); + window.setTimeout(resolve, z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); }, close: () => { const isIncomingCall = callState === z.calling.enum.CALL_STATE.INCOMING; @@ -1549,8 +1549,9 @@ z.calling.CallingRepository = class CallingRepository { if (callingConfig) { this._clearConfigTimeout(); - const ttl = callingConfig.ttl * 0.9 || CallingRepository.CONFIG.DEFAULT_CONFIG_TTL; - const timeout = Math.min(ttl, CallingRepository.CONFIG.DEFAULT_CONFIG_TTL) * 1000; + const {DEFAULT_CONFIG_TTL} = CallingRepository.CONFIG; + const ttl = callingConfig.ttl * 0.9 || DEFAULT_CONFIG_TTL; + const timeout = Math.min(ttl, DEFAULT_CONFIG_TTL) * z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; const expirationDate = new Date(Date.now() + timeout); callingConfig.expiration = expirationDate; diff --git a/app/script/calling/entities/CallEntity.js b/app/script/calling/entities/CallEntity.js index e5906eeed09..c52785b3fb2 100644 --- a/app/script/calling/entities/CallEntity.js +++ b/app/script/calling/entities/CallEntity.js @@ -31,10 +31,10 @@ z.calling.entities.CallEntity = class CallEntity { MAXIMUM_TIMEOUT: 90, MINIMUM_TIMEOUT: 60, }, - STATE_TIMEOUT: 30 * 1000, + STATE_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 30, TIMER: { INIT_THRESHOLD: 100, - UPDATE_INTERVAL: 1000, + UPDATE_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND, }, }; } @@ -148,7 +148,7 @@ z.calling.entities.CallEntity = class CallEntity { this.timerStart = Date.now() - CallEntity.CONFIG.TIMER.INIT_THRESHOLD; this.callTimerInterval = window.setInterval(() => { - const durationInSeconds = Math.floor((Date.now() - this.timerStart) / 1000); + const durationInSeconds = Math.floor((Date.now() - this.timerStart) / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); this.durationTime(durationInSeconds); }, CallEntity.CONFIG.TIMER.UPDATE_INTERVAL); } @@ -511,7 +511,7 @@ z.calling.entities.CallEntity = class CallEntity { const {MAXIMUM_TIMEOUT, MINIMUM_TIMEOUT} = CallEntity.CONFIG.GROUP_CHECK; const timeoutInSeconds = z.util.NumberUtil.getRandomNumber(MINIMUM_TIMEOUT, MAXIMUM_TIMEOUT); - const timeout = timeoutInSeconds * 1000; + const timeout = timeoutInSeconds * z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; this.groupCheckTimeoutId = window.setTimeout(() => this._onSendGroupCheckTimeout(timeoutInSeconds), timeout); const timeoutId = this.groupCheckTimeoutId; @@ -525,8 +525,9 @@ z.calling.entities.CallEntity = class CallEntity { */ _setVerifyGroupCheckTimeout() { const {ACTIVITY_TIMEOUT} = CallEntity.CONFIG.GROUP_CHECK; + const timeout = ACTIVITY_TIMEOUT * z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; - this.groupCheckTimeoutId = window.setTimeout(() => this._onVerifyGroupCheckTimeout(), ACTIVITY_TIMEOUT * 1000); + this.groupCheckTimeoutId = window.setTimeout(() => this._onVerifyGroupCheckTimeout(), timeout); this.callLogger.debug(`Set verifying group check after '${ACTIVITY_TIMEOUT}s' (ID: ${this.groupCheckTimeoutId})`); } diff --git a/app/script/calling/entities/FlowEntity.js b/app/script/calling/entities/FlowEntity.js index f39076021f3..663956a6119 100644 --- a/app/script/calling/entities/FlowEntity.js +++ b/app/script/calling/entities/FlowEntity.js @@ -27,10 +27,10 @@ z.calling.entities.FlowEntity = class FlowEntity { static get CONFIG() { return { DATA_CHANNEL_LABEL: 'calling-3.0', - NEGOTIATION_FAILED_TIMEOUT: 30 * 1000 + 500, - NEGOTIATION_RESTART_TIMEOUT: 2500, - SDP_SEND_TIMEOUT: 5 * 1000, - SDP_SEND_TIMEOUT_RESET: 1000, + NEGOTIATION_FAILED_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 30.5, + NEGOTIATION_RESTART_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 2.5, + SDP_SEND_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 5, + SDP_SEND_TIMEOUT_RESET: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND, }; } diff --git a/app/script/conversation/ConversationEphemeralHandler.js b/app/script/conversation/ConversationEphemeralHandler.js index a709b3a6870..f26ea1919ea 100644 --- a/app/script/conversation/ConversationEphemeralHandler.js +++ b/app/script/conversation/ConversationEphemeralHandler.js @@ -26,7 +26,7 @@ z.conversation.ConversationEphemeralHandler = class ConversationEphemeralHandler .AbstractConversationEventHandler { static get CONFIG() { return { - INTERVAL_TIME: 250, + INTERVAL_TIME: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 0.25, TIMER_RANGE: { MAX: z.util.TimeUtil.UNITS_IN_MILLIS.YEAR, MIN: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND, diff --git a/app/script/conversation/ConversationRepository.js b/app/script/conversation/ConversationRepository.js index 3a3e621aa75..010916711b8 100644 --- a/app/script/conversation/ConversationRepository.js +++ b/app/script/conversation/ConversationRepository.js @@ -26,7 +26,7 @@ window.z.conversation = z.conversation || {}; z.conversation.ConversationRepository = class ConversationRepository { static get CONFIG() { return { - CONFIRMATION_THRESHOLD: 7 * 24 * 60 * 60 * 1000, + CONFIRMATION_THRESHOLD: z.util.TimeUtil.UNITS_IN_MILLIS.WEEK, EXTERNAL_MESSAGE_THRESHOLD: 200 * 1024, GROUP: { MAX_NAME_LENGTH: 64, @@ -2512,7 +2512,7 @@ z.conversation.ConversationRepository = class ConversationRepository { }) .then(() => this.send_asset_remotedata(conversation_et, file, message_id)) .then(() => { - const upload_duration = (Date.now() - upload_started) / 1000; + const upload_duration = (Date.now() - upload_started) / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; this.logger.info(`Finished to upload asset for conversation'${conversation_et.id} in ${upload_duration}`); }) .catch(error => { @@ -3739,7 +3739,7 @@ z.conversation.ConversationRepository = class ConversationRepository { if (isEphemeral) { message = genericMessage.ephemeral; messageContentType = genericMessage.ephemeral.content; - messageTimer = genericMessage.ephemeral.expire_after_millis / 1000; + messageTimer = genericMessage.ephemeral.expire_after_millis / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; } else { message = genericMessage; messageContentType = genericMessage.content; diff --git a/app/script/cryptography/CryptographyMapper.js b/app/script/cryptography/CryptographyMapper.js index ce7e29a2290..6b19b541b9b 100644 --- a/app/script/cryptography/CryptographyMapper.js +++ b/app/script/cryptography/CryptographyMapper.js @@ -175,7 +175,9 @@ z.cryptography.CryptographyMapper = class CryptographyMapper { const audioData = original.audio; if (audioData) { const loudnessArray = audioData.normalized_loudness ? audioData.normalized_loudness.toArrayBuffer() : []; - const durationInSeconds = audioData.duration_in_millis ? audioData.duration_in_millis / 1000 : 0; + const durationInSeconds = audioData.duration_in_millis + ? audioData.duration_in_millis / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND + : 0; return { duration: durationInSeconds, diff --git a/app/script/entity/User.js b/app/script/entity/User.js index a339b6d1890..c68afd39abc 100644 --- a/app/script/entity/User.js +++ b/app/script/entity/User.js @@ -39,9 +39,9 @@ z.entity.User = class User { static get CONFIG() { return { TEMPORARY_GUEST: { - EXPIRATION_INTERVAL: 60 * 1000, - EXPIRATION_THRESHOLD: 10 * 1000, - LIFETIME: 24 * 60 * 60 * 1000, + EXPIRATION_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE, + EXPIRATION_THRESHOLD: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 10, + LIFETIME: z.util.TimeUtil.UNITS_IN_MILLIS.DAY, }, }; } @@ -273,11 +273,8 @@ z.entity.User = class User { } _setRemainingExpirationTime(expirationTime) { - const MILLISECONDS_IN_MINUTE = 60 * 1000; - const MILLISECONDS_IN_HOUR = MILLISECONDS_IN_MINUTE * 60; - const remainingTime = z.util.NumberUtil.clamp(expirationTime - Date.now(), 0, User.CONFIG.TEMPORARY_GUEST.LIFETIME); - const remainingMinutes = Math.ceil(remainingTime / MILLISECONDS_IN_MINUTE); + const remainingMinutes = Math.ceil(remainingTime / z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE); let timeLeftText = z.string.userRemainingTimeHours; let timeValue = 0; @@ -286,12 +283,12 @@ z.entity.User = class User { timeLeftText = z.string.userRemainingTimeMinutes; const remainingQuarters = Math.max(1, Math.ceil(remainingMinutes / 15)); timeValue = remainingQuarters * 15; - this.expirationRemaining(timeValue * MILLISECONDS_IN_MINUTE); + this.expirationRemaining(timeValue * z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE); this.expirationRemainingText(`${timeValue}m`); } else { const showOneAndAHalf = remainingMinutes > 60 && remainingMinutes <= 90; timeValue = showOneAndAHalf ? 1.5 : Math.ceil(remainingMinutes / 60); - this.expirationRemaining(timeValue * MILLISECONDS_IN_HOUR); + this.expirationRemaining(timeValue * z.util.TimeUtil.UNITS_IN_MILLIS.HOUR); this.expirationRemainingText(`${timeValue}h`); } diff --git a/app/script/entity/message/File.js b/app/script/entity/message/File.js index 26c50c736a0..114466dc22b 100644 --- a/app/script/entity/message/File.js +++ b/app/script/entity/message/File.js @@ -124,7 +124,7 @@ z.entity.File = class File extends z.entity.Asset { return this.load() .then(blob => z.util.downloadBlob(blob, this.file_name)) .then(() => { - const download_duration = (Date.now() - download_started) / 1000; + const download_duration = (Date.now() - download_started) / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; this.logger.info(`Downloaded asset in ${download_duration} seconds`); }) .catch(error => { diff --git a/app/script/entity/message/Message.js b/app/script/entity/message/Message.js index 599c2880c5b..fa4c9558cd7 100644 --- a/app/script/entity/message/Message.js +++ b/app/script/entity/message/Message.js @@ -82,7 +82,7 @@ z.entity.Message = class Message { this.category = undefined; this.display_timestamp_short = () => { - const date = moment.unix(this.timestamp() / 1000); + const date = moment.unix(this.timestamp() / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); return date.local().format('HH:mm'); }; diff --git a/app/script/ephemeral/ephemeralTimings.js b/app/script/ephemeral/ephemeralTimings.js index c7e55b80fe3..306fa9558eb 100644 --- a/app/script/ephemeral/ephemeralTimings.js +++ b/app/script/ephemeral/ephemeralTimings.js @@ -25,12 +25,12 @@ window.z.ephemeral = z.ephemeral || {}; z.ephemeral.timings = class { static get VALUES() { return [ - 1000 * 10, - 1000 * 60 * 5, - 1000 * 60 * 60, - 1000 * 60 * 60 * 24, - 1000 * 60 * 60 * 24 * 7, - 1000 * 60 * 60 * 24 * 28, + z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 10, + z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE * 5, + z.util.TimeUtil.UNITS_IN_MILLIS.HOUR, + z.util.TimeUtil.UNITS_IN_MILLIS.DAY, + z.util.TimeUtil.UNITS_IN_MILLIS.WEEK, + z.util.TimeUtil.UNITS_IN_MILLIS.WEEK * 4, ]; } }; diff --git a/app/script/event/EventRepository.js b/app/script/event/EventRepository.js index 726799b0b15..11e6aa32687 100644 --- a/app/script/event/EventRepository.js +++ b/app/script/event/EventRepository.js @@ -25,7 +25,7 @@ window.z.event = z.event || {}; z.event.EventRepository = class EventRepository { static get CONFIG() { return { - E_CALL_EVENT_LIFETIME: 30 * 1000, // 30 seconds + E_CALL_EVENT_LIFETIME: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 30, IGNORED_ERRORS: [ z.cryptography.CryptographyError.TYPE.IGNORED_ASSET, z.cryptography.CryptographyError.TYPE.IGNORED_PREVIEW, diff --git a/app/script/event/WebSocketService.js b/app/script/event/WebSocketService.js index 4d9836f5aa1..89f51b394da 100644 --- a/app/script/event/WebSocketService.js +++ b/app/script/event/WebSocketService.js @@ -40,9 +40,9 @@ z.event.WebSocketService = class WebSocketService { static get CONFIG() { return { - PING_INTERVAL: 30000, - PING_INTERVAL_THRESHOLD: 2000, - RECONNECT_INTERVAL: 15000, + PING_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 30, + PING_INTERVAL_THRESHOLD: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 2, + RECONNECT_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 15, }; } diff --git a/app/script/lifecycle/LifecycleRepository.js b/app/script/lifecycle/LifecycleRepository.js index f95cb0a0819..fb442d06c10 100644 --- a/app/script/lifecycle/LifecycleRepository.js +++ b/app/script/lifecycle/LifecycleRepository.js @@ -25,9 +25,9 @@ window.z.lifecycle = z.lifecycle || {}; z.lifecycle.LifecycleRepository = class LifecycleRepository { static get CONFIG() { return { - CHECK_INTERVAL: 3 * 60 * 60 * 1000, - CHECK_TIMEOUT: 5 * 60 * 1000, - UPDATE_INTERVAL: 6 * 60 * 60 * 1000, + CHECK_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.HOUR * 3, + CHECK_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE * 5, + UPDATE_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.HOUR * 6, }; } diff --git a/app/script/main/app.js b/app/script/main/app.js index cf6a2914300..ed1fde7e069 100644 --- a/app/script/main/app.js +++ b/app/script/main/app.js @@ -28,7 +28,7 @@ z.main.App = class App { COOKIES_CHECK: { COOKIE_NAME: 'cookies_enabled', }, - NOTIFICATION_CHECK: 10 * 1000, + NOTIFICATION_CHECK: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 10, SIGN_OUT_REASONS: { IMMEDIATE: [ z.auth.SIGN_OUT_REASON.ACCOUNT_DELETED, @@ -43,7 +43,7 @@ z.main.App = class App { }, TABS_CHECK: { COOKIE_NAME: 'app_opened', - INTERVAL: 1000, + INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND, }, }; } diff --git a/app/script/notification/NotificationRepository.js b/app/script/notification/NotificationRepository.js index 9fda710b50f..aa90efeb27a 100644 --- a/app/script/notification/NotificationRepository.js +++ b/app/script/notification/NotificationRepository.js @@ -33,7 +33,7 @@ z.notification.NotificationRepository = class NotificationRepository { return { BODY_LENGTH: 80, ICON_URL: '/image/logo/notification.png', - TIMEOUT: 5 * 1000, + TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 5, TITLE_LENGTH: 38, }; } diff --git a/app/script/service/BackendClient.js b/app/script/service/BackendClient.js index 3372f9a4638..64d1620bc0a 100644 --- a/app/script/service/BackendClient.js +++ b/app/script/service/BackendClient.js @@ -27,10 +27,10 @@ z.service.BackendClient = class BackendClient { return { CONNECTIVITY_CHECK: { INITIAL_TIMEOUT: 0, - RECHECK_TIMEOUT: 2000, - REQUEST_TIMEOUT: 500, + RECHECK_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 2, + REQUEST_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 0.5, }, - QUEUE_CHECK_TIMEOUT: 60 * 1000, + QUEUE_CHECK_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE, }; } diff --git a/app/script/telemetry/app_init/AppInitTimings.js b/app/script/telemetry/app_init/AppInitTimings.js index 0585ea0f2b9..5f8d87d1716 100644 --- a/app/script/telemetry/app_init/AppInitTimings.js +++ b/app/script/telemetry/app_init/AppInitTimings.js @@ -50,10 +50,11 @@ z.telemetry.app_init.AppInitTimings = class AppInitTimings { } get_app_load() { - const app_loaded_in_seconds = this[z.telemetry.app_init.AppInitTimingsStep.APP_LOADED] / 1000; - return ( - (Math.floor(app_loaded_in_seconds / AppInitTimings.CONFIG.BUCKET_SIZE) + 1) * AppInitTimings.CONFIG.BUCKET_SIZE - ); + const {CONFIG} = AppInitTimings; + const appLoaded = this[z.telemetry.app_init.AppInitTimingsStep.APP_LOADED]; + const appLoadedInSeconds = appLoaded / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; + + return (Math.floor(appLoadedInSeconds / CONFIG.BUCKET_SIZE) + 1) * CONFIG.BUCKET_SIZE; } log() { diff --git a/app/script/telemetry/calling/CallTelemetry.js b/app/script/telemetry/calling/CallTelemetry.js index 26a63a6fcc3..12a55d3d429 100644 --- a/app/script/telemetry/calling/CallTelemetry.js +++ b/app/script/telemetry/calling/CallTelemetry.js @@ -158,7 +158,7 @@ z.telemetry.calling.CallTelemetry = class CallTelemetry { track_duration(callEntity) { const {terminationReason, timerStart, durationTime} = callEntity; - const duration = Math.floor((Date.now() - timerStart) / 1000); + const duration = Math.floor((Date.now() - timerStart) / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); if (!window.isNaN(duration)) { this.logger.info(`Call duration: ${duration} seconds.`, durationTime()); diff --git a/app/script/tracking/EventTrackingRepository.js b/app/script/tracking/EventTrackingRepository.js index 2ab0892ebec..32aab164e8c 100644 --- a/app/script/tracking/EventTrackingRepository.js +++ b/app/script/tracking/EventTrackingRepository.js @@ -34,7 +34,7 @@ z.tracking.EventTrackingRepository = class EventTrackingRepository { return { ERROR_REPORTING: { API_KEY: RAYGUN_API_KEY, - REPORTING_THRESHOLD: 60 * 1000, // milliseconds + REPORTING_THRESHOLD: z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE, }, USER_ANALYTICS: { API_KEY: MIXPANEL_TOKEN, diff --git a/app/script/user/UserRepository.js b/app/script/user/UserRepository.js index 2d3374d2b3d..9db1c3bbd5e 100644 --- a/app/script/user/UserRepository.js +++ b/app/script/user/UserRepository.js @@ -68,7 +68,7 @@ z.user.UserRepository = class UserRepository { .filter(user_et => user_et.is_connected()) .sort((user_a, user_b) => z.util.StringUtil.sortByPriority(user_a.first_name(), user_b.first_name())); }) - .extend({rateLimit: 1000}); + .extend({rateLimit: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND}); this.isActivatedAccount = ko.pureComputed(() => this.self() && !this.self().isTemporaryGuest()); this.isTemporaryGuest = ko.pureComputed(() => this.self() && this.self().isTemporaryGuest()); diff --git a/app/script/util/PromiseQueue.js b/app/script/util/PromiseQueue.js index 19c7e900725..9210ab52402 100644 --- a/app/script/util/PromiseQueue.js +++ b/app/script/util/PromiseQueue.js @@ -25,7 +25,7 @@ window.z.util = z.util || {}; z.util.PromiseQueue = class PromiseQueue { static get CONFIG() { return { - UNBLOCK_INTERVAL: 60 * 1000, + UNBLOCK_INTERVAL: z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE, }; } diff --git a/app/script/util/StorageUtil.js b/app/script/util/StorageUtil.js index bd6f2f2f2b6..0fbbb407a01 100644 --- a/app/script/util/StorageUtil.js +++ b/app/script/util/StorageUtil.js @@ -30,9 +30,7 @@ z.util.StorageUtil = { return z.util.StorageUtil.setValue(key, null); }, setValue: function(key, value, secondsToExpire) { - if (secondsToExpire) { - return amplify.store(key, value, {expires: secondsToExpire * 1000}); - } - return amplify.store(key, value); + const config = secondsToExpire ? {expires: secondsToExpire * z.util.TimeUtil.UNITS_IN_MILLIS.SECOND} : undefined; + return amplify.store(key, value, config); }, }; diff --git a/app/script/util/TimeUtil.js b/app/script/util/TimeUtil.js index 155d340be85..71e58a739fe 100644 --- a/app/script/util/TimeUtil.js +++ b/app/script/util/TimeUtil.js @@ -160,5 +160,5 @@ z.util.TimeUtil = { getCurrentDate: () => new Date().toISOString().substring(0, 10), - getUnixTimestamp: () => Math.floor(Date.now() / 1000), + getUnixTimestamp: () => Math.floor(Date.now() / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND), }; diff --git a/app/script/view_model/AuthViewModel.js b/app/script/view_model/AuthViewModel.js index 760b1d88dbb..3864048174d 100644 --- a/app/script/view_model/AuthViewModel.js +++ b/app/script/view_model/AuthViewModel.js @@ -34,7 +34,7 @@ z.viewModel.AuthViewModel = class AuthViewModel { z.auth.URLParameter.LOCALE, z.auth.URLParameter.TRACKING, ], - RESET_TIMEOUT: 2000, + RESET_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 2, }; } diff --git a/app/script/view_model/VideoCallingViewModel.js b/app/script/view_model/VideoCallingViewModel.js index 8125281a391..5ee2ca5136a 100644 --- a/app/script/view_model/VideoCallingViewModel.js +++ b/app/script/view_model/VideoCallingViewModel.js @@ -25,8 +25,8 @@ window.z.viewModel = z.viewModel || {}; z.viewModel.VideoCallingViewModel = class VideoCallingViewModel { static get CONFIG() { return { - AUTO_MINIMIZE_TIMEOUT: 4 * 1000, - HIDE_CONTROLS_TIMEOUT: 4 * 1000, + AUTO_MINIMIZE_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 4, + HIDE_CONTROLS_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 4, }; } diff --git a/app/script/view_model/bindings/CommonBindings.js b/app/script/view_model/bindings/CommonBindings.js index dbe0f576afd..2f6609d49a7 100644 --- a/app/script/view_model/bindings/CommonBindings.js +++ b/app/script/view_model/bindings/CommonBindings.js @@ -228,7 +228,7 @@ ko.bindingHandlers.file_select = { // wait before clearing to fix autotests window.setTimeout(() => { $(event.target).val(null); - }, 1000); + }, z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); } }; @@ -386,13 +386,11 @@ ko.bindingHandlers.relative_timestamp = (function() { const timestamps = []; // should be fine to fire all 60 sec - window.setInterval(() => { - timestamps.map(timestamp_func => timestamp_func()); - }, 60 * 1000); + window.setInterval(() => timestamps.map(timestamp_func => timestamp_func()), z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE); const calculate = function(element, timestamp) { timestamp = window.parseInt(timestamp); - const date = moment.unix(timestamp / 1000); + const date = moment.unix(timestamp / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); const now = moment().local(); const today = now.format('YYMMDD'); diff --git a/app/script/view_model/bindings/MessageListBindings.js b/app/script/view_model/bindings/MessageListBindings.js index 056a8a02431..e4fa9e22359 100644 --- a/app/script/view_model/bindings/MessageListBindings.js +++ b/app/script/view_model/bindings/MessageListBindings.js @@ -190,13 +190,11 @@ ko.bindingHandlers.relative_timestamp = (function() { }; // should be fine to update every minute - window.setInterval(() => { - timestamps.map(timestamp_func => timestamp_func()); - }, 60 * 1000); + window.setInterval(() => timestamps.map(timestamp_func => timestamp_func()), z.util.TimeUtil.UNITS_IN_MILLIS.MINUTE); const calculate = function(element, timestamp, is_day) { timestamp = window.parseInt(timestamp); - const date = moment.unix(timestamp / 1000); + const date = moment.unix(timestamp / z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); if (is_day) { return $(element).text(calculate_timestamp_day(date)); diff --git a/app/script/view_model/content/InputBarViewModel.js b/app/script/view_model/content/InputBarViewModel.js index f4b684b7b24..403bc7bc92a 100644 --- a/app/script/view_model/content/InputBarViewModel.js +++ b/app/script/view_model/content/InputBarViewModel.js @@ -34,7 +34,7 @@ z.viewModel.content.InputBarViewModel = class InputBarViewModel { IMAGE: { FILE_TYPES: ['image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/png', '.jpg-large'], }, - PING_TIMEOUT: 2000, + PING_TIMEOUT: z.util.TimeUtil.UNITS_IN_MILLIS.SECOND * 2, }; } diff --git a/app/script/view_model/content/MessageListViewModel.js b/app/script/view_model/content/MessageListViewModel.js index f06ffa2550c..9c00f74e1a1 100644 --- a/app/script/view_model/content/MessageListViewModel.js +++ b/app/script/view_model/content/MessageListViewModel.js @@ -131,7 +131,7 @@ z.viewModel.content.MessageListViewModel = class MessageListViewModel { window.setTimeout(() => { this.conversation_repository.mark_as_read(this.mark_as_read_on_focus); this.mark_as_read_on_focus = undefined; - }, 1000); + }, z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); } }); diff --git a/app/script/view_model/content/TitleBarViewModel.js b/app/script/view_model/content/TitleBarViewModel.js index e39a258e52c..cacc5ebdfaf 100644 --- a/app/script/view_model/content/TitleBarViewModel.js +++ b/app/script/view_model/content/TitleBarViewModel.js @@ -43,7 +43,7 @@ z.viewModel.content.TitleBarViewModel = class TitleBarViewModel { this.isActivatedAccount = mainViewModel.isActivatedAccount; // TODO remove the titlebar for now to ensure that buttons are clickable in macOS wrappers - window.setTimeout(() => $('.titlebar').remove(), 1000); + window.setTimeout(() => $('.titlebar').remove(), z.util.TimeUtil.UNITS_IN_MILLIS.SECOND); this.conversationEntity = this.conversationRepository.active_conversation; From 52310a3ff4a7398cb566fcb517478dc091496f2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 27 Jun 2018 10:25:13 +0200 Subject: [PATCH 69/99] chore: Update webpack to version 4.12.2 (#3833) --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4e0c1e95791..b914f78f01a 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "stylelint-config-prettier": "3.3.0", "uglify-js": "3.4.2", "uglifyjs-webpack-plugin": "1.2.7", - "webpack": "4.12.1", + "webpack": "4.12.2", "webpack-cli": "3.0.8", "webpack-dev-server": "3.1.4" }, diff --git a/yarn.lock b/yarn.lock index 919700e322b..b6597b9dd79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10887,9 +10887,9 @@ webpack-sources@^1.0.1, webpack-sources@^1.1.0: source-list-map "^2.0.0" source-map "~0.6.1" -webpack@4.12.1: - version "4.12.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.12.1.tgz#9108078c67fdd72c2609cea22af87d7aed2acb08" +webpack@4.12.2: + version "4.12.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.12.2.tgz#d2b8418eb40cedcbf2c1f5905d23a99546011ce9" dependencies: "@webassemblyjs/ast" "1.5.12" "@webassemblyjs/helper-module-context" "1.5.12" From 481956782ed30e6bfc3ab9441f5e718c9d74c3f5 Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Wed, 27 Jun 2018 10:55:23 +0200 Subject: [PATCH 70/99] chore: Add "yarn dist" script (#3834) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b914f78f01a..de0e550ad80 100644 --- a/package.json +++ b/package.json @@ -161,6 +161,7 @@ "deploy-travis-dev": "grunt app_deploy_travis:dev", "deploy-travis-prod": "grunt app_deploy_travis:prod", "deploy-travis-staging": "grunt app_deploy_travis:staging", + "dist": "grunt prepare_dist", "fix": "yarn fix:assets && yarn fix:scripts", "fix:assets": "yarn prettier --write && yarn stylelint", "fix:scripts": "yarn test:scripts --fix", From f6d14a1ec13009d69c6cf35e8ffe3a3f5c9c9602 Mon Sep 17 00:00:00 2001 From: Thomas Belin Date: Wed, 27 Jun 2018 11:56:12 +0200 Subject: [PATCH 71/99] fix: Uses server time for ephemeral computation on own messages (#3836) --- app/script/components/ephemeralTimer.js | 8 +++----- .../conversation/ConversationEphemeralHandler.js | 8 +++++--- app/script/conversation/ConversationRepository.js | 13 ++++++++----- app/script/conversation/EventBuilder.js | 3 ++- app/script/entity/message/Message.js | 6 +++--- app/script/event/EventRepository.js | 2 +- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/script/components/ephemeralTimer.js b/app/script/components/ephemeralTimer.js index 9166819e1de..ea9f8ad33d3 100644 --- a/app/script/components/ephemeralTimer.js +++ b/app/script/components/ephemeralTimer.js @@ -23,14 +23,12 @@ window.z = window.z || {}; window.z.components = z.components || {}; z.components.EphemeralTimer = class EphemeralTimer { - constructor(params, componentInfo) { - const messageEntity = params.message; - - const ephemeralDuration = messageEntity.ephemeral_expires() - messageEntity.ephemeral_started(); + constructor({message: messageEntity}, componentInfo) { + const duration = messageEntity.ephemeral_expires() - messageEntity.ephemeral_started(); const dashLength = 12.6; this.remainingTime = messageEntity.ephemeral_expires() - Date.now(); - this.initialDashOffset = dashLength - (this.remainingTime / ephemeralDuration) * -dashLength; + this.initialDashOffset = dashLength - (this.remainingTime / duration) * -dashLength; const dial = componentInfo.element.querySelector('.ephemeral-timer__dial'); z.util.afterRender(() => (dial.style.strokeDashoffset = dashLength)); diff --git a/app/script/conversation/ConversationEphemeralHandler.js b/app/script/conversation/ConversationEphemeralHandler.js index f26ea1919ea..290fb065d98 100644 --- a/app/script/conversation/ConversationEphemeralHandler.js +++ b/app/script/conversation/ConversationEphemeralHandler.js @@ -79,10 +79,12 @@ z.conversation.ConversationEphemeralHandler = class ConversationEphemeralHandler /** * Check the remaining lifetime for a given ephemeral message. + * * @param {Message} messageEntity - Message to check + * @param {number} timeOffset - Approximate time different to backend in milliseconds * @returns {undefined} No return value */ - checkMessageTimer(messageEntity) { + checkMessageTimer(messageEntity, timeOffset) { switch (messageEntity.ephemeral_status()) { case z.message.EphemeralStatusType.TIMED_OUT: { this._timeoutEphemeralMessage(messageEntity); @@ -90,12 +92,12 @@ z.conversation.ConversationEphemeralHandler = class ConversationEphemeralHandler } case z.message.EphemeralStatusType.ACTIVE: { - messageEntity.startMessageTimer(); + messageEntity.startMessageTimer(timeOffset); break; } case z.message.EphemeralStatusType.INACTIVE: { - messageEntity.startMessageTimer(); + messageEntity.startMessageTimer(timeOffset); this.conversationService.update_message_in_db(messageEntity, { ephemeral_expires: messageEntity.ephemeral_expires(), ephemeral_started: messageEntity.ephemeral_started(), diff --git a/app/script/conversation/ConversationRepository.js b/app/script/conversation/ConversationRepository.js index 010916711b8..21fd6909278 100644 --- a/app/script/conversation/ConversationRepository.js +++ b/app/script/conversation/ConversationRepository.js @@ -159,7 +159,10 @@ z.conversation.ConversationRepository = class ConversationRepository { this.conversation_mapper, {onMessageTimeout: this.handleMessageExpiration.bind(this)} ); - this.checkMessageTimer = this.ephemeralHandler.checkMessageTimer; + } + + checkMessageTimer(messageEntity) { + this.ephemeralHandler.checkMessageTimer(messageEntity, this.timeOffset); } _initStateUpdates() { @@ -206,7 +209,7 @@ z.conversation.ConversationRepository = class ConversationRepository { z.event.WebApp.EVENT.NOTIFICATION_HANDLING_STATE, this.set_notification_handling_state.bind(this) ); - amplify.subscribe(z.event.WebApp.EVENT.UPDATE_TIME_OFFSET, this.update_time_offset.bind(this)); + amplify.subscribe(z.event.WebApp.EVENT.UPDATE_TIME_OFFSET, this.updateTimeOffset.bind(this)); amplify.subscribe(z.event.WebApp.TEAM.MEMBER_LEAVE, this.teamMemberLeave.bind(this)); amplify.subscribe(z.event.WebApp.USER.UNBLOCKED, this.unblocked_user.bind(this)); } @@ -1069,11 +1072,11 @@ z.conversation.ConversationRepository = class ConversationRepository { /** * Update time offset. - * @param {number} time_offset - Approximate time different to backend in milliseconds + * @param {number} timeOffset - Approximate time different to backend in milliseconds * @returns {undefined} No return value */ - update_time_offset(time_offset) { - this.timeOffset = time_offset; + updateTimeOffset(timeOffset) { + this.timeOffset = timeOffset; } /** diff --git a/app/script/conversation/EventBuilder.js b/app/script/conversation/EventBuilder.js index 2a7651809e6..70f68916ea2 100644 --- a/app/script/conversation/EventBuilder.js +++ b/app/script/conversation/EventBuilder.js @@ -208,7 +208,8 @@ z.conversation.EventBuilder = { }; }, buildVoiceChannelDeactivate(callMessageEntity, reason, timeOffset = 0) { - const {conversationId, userId, time = new Date(Date.now() - timeOffset).toISOString()} = callMessageEntity; + const {conversationId, userId} = callMessageEntity; + const time = callMessageEntity.time || new Date(z.util.TimeUtil.adjustCurrentTimestamp(timeOffset)).toISOString(); return { conversation: conversationId, diff --git a/app/script/entity/message/Message.js b/app/script/entity/message/Message.js index fa4c9558cd7..7c4a34e8870 100644 --- a/app/script/entity/message/Message.js +++ b/app/script/entity/message/Message.js @@ -263,19 +263,19 @@ z.entity.Message = class Message { } // Start the ephemeral timer for the message. - startMessageTimer() { + startMessageTimer(timeOffset) { if (this.messageTimerStarted) { return; } if (this.ephemeral_status() === z.message.EphemeralStatusType.INACTIVE) { - const startingTimestamp = this.user().is_me ? this.timestamp() : Date.now(); + const startingTimestamp = this.user().is_me ? Math.min(this.timestamp() + timeOffset, Date.now()) : Date.now(); const expirationTimestamp = `${startingTimestamp + this.ephemeral_expires()}`; this.ephemeral_expires(expirationTimestamp); this.ephemeral_started(`${startingTimestamp}`); } - const remainingTime = this.ephemeral_expires() - Date.now(); + const remainingTime = this.ephemeral_expires() - this.ephemeral_started(); this.ephemeral_remaining(remainingTime); this.messageTimerStarted = true; } diff --git a/app/script/event/EventRepository.js b/app/script/event/EventRepository.js index 11e6aa32687..c92529627aa 100644 --- a/app/script/event/EventRepository.js +++ b/app/script/event/EventRepository.js @@ -755,7 +755,7 @@ z.event.EventRepository = class EventRepository { const {content = {}, conversation: conversationId, time, type} = event; const forcedEventTypes = [z.calling.enum.CALL_MESSAGE_TYPE.CANCEL, z.calling.enum.CALL_MESSAGE_TYPE.GROUP_LEAVE]; - const correctedTimestamp = Date.now() - this.timeOffset; + const correctedTimestamp = z.util.TimeUtil.adjustCurrentTimestamp(this.timeOffset); const thresholdTimestamp = new Date(time).getTime() + EventRepository.CONFIG.E_CALL_EVENT_LIFETIME; const isForcedEventType = forcedEventTypes.includes(content.type); From 6d909f8be265f162faa7712765c9f9447295c497 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 12:14:35 +0200 Subject: [PATCH 72/99] fix: Show expected error on phone login with short password (#3835) --- app/script/view_model/AuthViewModel.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/script/view_model/AuthViewModel.js b/app/script/view_model/AuthViewModel.js index 3864048174d..ddb653f3067 100644 --- a/app/script/view_model/AuthViewModel.js +++ b/app/script/view_model/AuthViewModel.js @@ -1464,10 +1464,9 @@ z.viewModel.AuthViewModel = class AuthViewModel { */ _validate_password(mode) { if (this.password().length < z.config.MINIMUM_PASSWORD_LENGTH) { - if (mode === z.auth.AuthView.MODE.ACCOUNT_PASSWORD) { - return this._add_error(z.string.authErrorPasswordWrong, z.auth.AuthView.TYPE.PASSWORD); - } - this._add_error(z.string.authErrorPasswordShort, z.auth.AuthView.TYPE.PASSWORD); + const isPasswordVerification = mode === z.auth.AuthView.MODE.VERIFY_PASSWORD; + const stringId = isPasswordVerification ? z.string.authErrorPasswordWrong : z.string.authErrorPasswordShort; + this._add_error(stringId, z.auth.AuthView.TYPE.PASSWORD); } } From e9edde049c4caee4fbb46dbb37e4b18aae119eb3 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 14:33:22 +0200 Subject: [PATCH 73/99] fix: Start timer when message was sent (#3837) --- .../ConversationEphemeralHandler.js | 5 ++ .../conversation/ConversationRepository.js | 37 ++++++------ app/script/conversation/EventMapper.js | 10 ++-- app/script/entity/Conversation.js | 14 ++--- app/script/entity/message/ContentMessage.js | 4 +- .../content/MessageListViewModel.js | 2 +- test/unit_tests/entity/ConversationSpec.js | 60 +++++++++++-------- 7 files changed, 72 insertions(+), 60 deletions(-) diff --git a/app/script/conversation/ConversationEphemeralHandler.js b/app/script/conversation/ConversationEphemeralHandler.js index 290fb065d98..e16cc960c78 100644 --- a/app/script/conversation/ConversationEphemeralHandler.js +++ b/app/script/conversation/ConversationEphemeralHandler.js @@ -85,6 +85,11 @@ z.conversation.ConversationEphemeralHandler = class ConversationEphemeralHandler * @returns {undefined} No return value */ checkMessageTimer(messageEntity, timeOffset) { + const hasHitBackend = messageEntity.status() > z.message.StatusType.SENDING; + if (!hasHitBackend) { + return; + } + switch (messageEntity.ephemeral_status()) { case z.message.EphemeralStatusType.TIMED_OUT: { this._timeoutEphemeralMessage(messageEntity); diff --git a/app/script/conversation/ConversationRepository.js b/app/script/conversation/ConversationRepository.js index 21fd6909278..44a1debe9c3 100644 --- a/app/script/conversation/ConversationRepository.js +++ b/app/script/conversation/ConversationRepository.js @@ -2171,7 +2171,7 @@ z.conversation.ConversationRepository = class ConversationRepository { this._trackContributed(conversation_et, generic_message); const backend_iso_date = sync_timestamp ? payload.time : ''; - return this._update_message_as_sent(conversation_et, message_stored, backend_iso_date); + return this._updateMessageAsSent(conversation_et, message_stored, backend_iso_date); }) .then(() => message_stored); }); @@ -2180,32 +2180,31 @@ z.conversation.ConversationRepository = class ConversationRepository { /** * Update message as sent in db and view. * - * @param {Conversation} conversation_et - Conversation entity - * @param {Object} event_json - Event object - * @param {string} iso_date - If defined it will update event timestamp + * @param {Conversation} conversationEntity - Conversation entity + * @param {Object} eventJson - Event object + * @param {string} isoDate - If defined it will update event timestamp * @returns {Promise} Resolves when sent status was updated */ - _update_message_as_sent(conversation_et, event_json, iso_date) { - return this.get_message_in_conversation_by_id(conversation_et, event_json.id) - .then(message_et => { - const changes = { - status: z.message.StatusType.SENT, - }; - message_et.status(z.message.StatusType.SENT); + _updateMessageAsSent(conversationEntity, eventJson, isoDate) { + return this.get_message_in_conversation_by_id(conversationEntity, eventJson.id) + .then(messageEntity => { + messageEntity.status(z.message.StatusType.SENT); - if (iso_date) { - changes.time = iso_date; + const changes = {status: z.message.StatusType.SENT}; + if (isoDate) { + changes.time = isoDate; - const timestamp = new Date(iso_date).getTime(); + const timestamp = new Date(isoDate).getTime(); if (!_.isNaN(timestamp)) { - message_et.timestamp(timestamp); - conversation_et.update_timestamp_server(timestamp, true); - conversation_et.update_timestamps(message_et); + messageEntity.timestamp(timestamp); + conversationEntity.update_timestamp_server(timestamp, true); + conversationEntity.update_timestamps(messageEntity); } } - if (z.event.EventTypeHandling.STORE.includes(message_et.type) || message_et.has_asset_image()) { - return this.conversation_service.update_message_in_db(message_et, changes); + this.checkMessageTimer(messageEntity); + if (z.event.EventTypeHandling.STORE.includes(messageEntity.type) || messageEntity.has_asset_image()) { + return this.conversation_service.update_message_in_db(messageEntity, changes); } }) .catch(error => { diff --git a/app/script/conversation/EventMapper.js b/app/script/conversation/EventMapper.js index 948b37d6e66..9f5c419fe35 100644 --- a/app/script/conversation/EventMapper.js +++ b/app/script/conversation/EventMapper.js @@ -162,12 +162,12 @@ z.conversation.EventMapper = class EventMapper { messageEntity.type = type; messageEntity.version = version || 1; + if (messageEntity.is_content()) { + messageEntity.status(event.status || z.message.StatusType.DELIVERED); + } + if (messageEntity.is_reactable()) { - const {reactions, status} = event; - messageEntity.reactions(reactions || {}); - if (status) { - messageEntity.status(status); - } + messageEntity.reactions(event.reactions || {}); } if (event.ephemeral_expires) { diff --git a/app/script/entity/Conversation.js b/app/script/entity/Conversation.js index f488a7e8605..2648c89b89c 100644 --- a/app/script/entity/Conversation.js +++ b/app/script/entity/Conversation.js @@ -569,14 +569,12 @@ z.entity.Conversation = class Conversation { * Get the last delivered message. * @returns {z.entity.Message} Last delivered message */ - get_last_delivered_message() { - const messages = this.messages(); - for (let index = messages.length - 1; index >= 0; index--) { - const message_et = messages[index]; - if (message_et.status() === z.message.StatusType.DELIVERED) { - return message_et; - } - } + getLastDeliveredMessage() { + const messageEntities = this.messages().reverse(); + return messageEntities.find(messageEntity => { + const isDelivered = messageEntity.status() === z.message.StatusType.DELIVERED; + return isDelivered && messageEntity.user().is_me; + }); } /** diff --git a/app/script/entity/message/ContentMessage.js b/app/script/entity/message/ContentMessage.js index 256b3f9c1e6..f1864f2c44c 100644 --- a/app/script/entity/message/ContentMessage.js +++ b/app/script/entity/message/ContentMessage.js @@ -23,8 +23,8 @@ window.z = window.z || {}; window.z.entity = z.entity || {}; z.entity.ContentMessage = class ContentMessage extends z.entity.Message { - constructor() { - super(); + constructor(id) { + super(id); this.assets = ko.observableArray([]); this.super_type = z.message.SuperType.CONTENT; diff --git a/app/script/view_model/content/MessageListViewModel.js b/app/script/view_model/content/MessageListViewModel.js index 9c00f74e1a1..6a4166d8660 100644 --- a/app/script/view_model/content/MessageListViewModel.js +++ b/app/script/view_model/content/MessageListViewModel.js @@ -495,7 +495,7 @@ z.viewModel.content.MessageListViewModel = class MessageListViewModel { * @returns {boolean} Message is last delivered one */ is_last_delivered_message(message_et) { - return this.conversation().get_last_delivered_message() === message_et; + return this.conversation().getLastDeliveredMessage() === message_et; } click_on_cancel_request(messageEntity) { diff --git a/test/unit_tests/entity/ConversationSpec.js b/test/unit_tests/entity/ConversationSpec.js index 71f0eb24c49..51613237261 100644 --- a/test/unit_tests/entity/ConversationSpec.js +++ b/test/unit_tests/entity/ConversationSpec.js @@ -248,35 +248,45 @@ describe('Conversation', () => { }); }); - describe('get_last_delivered_message', () => { + describe('getLastDeliveredMessage', () => { it('returns undefined if conversation has no messages', () => { - expect(conversation_et.get_last_delivered_message()).not.toBeDefined(); + expect(conversation_et.getLastDeliveredMessage()).not.toBeDefined(); }); it('returns last delivered message', () => { - const sent_message_et = new z.entity.ContentMessage(); - sent_message_et.id = z.util.createRandomUuid(); - sent_message_et.status(z.message.StatusType.SENT); - conversation_et.add_message(sent_message_et); - expect(conversation_et.get_last_delivered_message()).not.toBeDefined(); - - const delivered_message_et = new z.entity.ContentMessage(); - delivered_message_et.id = z.util.createRandomUuid(); - delivered_message_et.status(z.message.StatusType.DELIVERED); - conversation_et.add_message(delivered_message_et); - expect(conversation_et.get_last_delivered_message()).toBe(delivered_message_et); - - const next_sent_message_et = new z.entity.ContentMessage(); - next_sent_message_et.id = z.util.createRandomUuid(); - next_sent_message_et.status(z.message.StatusType.SENT); - conversation_et.add_message(next_sent_message_et); - expect(conversation_et.get_last_delivered_message()).toBe(delivered_message_et); - - const next_delivered_message_et = new z.entity.ContentMessage(); - next_delivered_message_et.id = z.util.createRandomUuid(); - next_delivered_message_et.status(z.message.StatusType.DELIVERED); - conversation_et.add_message(next_delivered_message_et); - expect(conversation_et.get_last_delivered_message()).toBe(next_delivered_message_et); + const remoteUserEntity = new z.entity.User(z.util.createRandomUuid()); + const selfUserEntity = new z.entity.User(z.util.createRandomUuid()); + selfUserEntity.is_me = true; + + const sentMessageEntity = new z.entity.ContentMessage(z.util.createRandomUuid()); + sentMessageEntity.user(selfUserEntity); + sentMessageEntity.status(z.message.StatusType.SENT); + conversation_et.add_message(sentMessageEntity); + expect(conversation_et.getLastDeliveredMessage()).not.toBeDefined(); + + const deliveredMessageEntity = new z.entity.ContentMessage(z.util.createRandomUuid()); + deliveredMessageEntity.user(selfUserEntity); + deliveredMessageEntity.status(z.message.StatusType.DELIVERED); + conversation_et.add_message(deliveredMessageEntity); + expect(conversation_et.getLastDeliveredMessage()).toBe(deliveredMessageEntity); + + const nextSentMessageEntity = new z.entity.ContentMessage(z.util.createRandomUuid()); + nextSentMessageEntity.user(selfUserEntity); + nextSentMessageEntity.status(z.message.StatusType.SENT); + conversation_et.add_message(nextSentMessageEntity); + expect(conversation_et.getLastDeliveredMessage()).toBe(deliveredMessageEntity); + + const nextDeliveredMessageEntity = new z.entity.ContentMessage(z.util.createRandomUuid()); + nextDeliveredMessageEntity.user(selfUserEntity); + nextDeliveredMessageEntity.status(z.message.StatusType.DELIVERED); + conversation_et.add_message(nextDeliveredMessageEntity); + expect(conversation_et.getLastDeliveredMessage()).toBe(nextDeliveredMessageEntity); + + const remoteMessageEntity = new z.entity.ContentMessage(z.util.createRandomUuid()); + remoteMessageEntity.user(remoteUserEntity); + remoteMessageEntity.status(z.message.StatusType.DELIVERED); + conversation_et.add_message(remoteMessageEntity); + expect(conversation_et.getLastDeliveredMessage()).toBe(nextDeliveredMessageEntity); }); }); From 290de420d58b7982c588eb508ae881394006f05a Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 15:20:36 +0200 Subject: [PATCH 74/99] fix: Remove device during login (#3839) --- app/script/auth/component/ClientList.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/script/auth/component/ClientList.jsx b/app/script/auth/component/ClientList.jsx index 4f18d97755b..f8e28c7e1df 100644 --- a/app/script/auth/component/ClientList.jsx +++ b/app/script/auth/component/ClientList.jsx @@ -55,8 +55,7 @@ class ClientList extends React.Component { removeClient = (clientId, password) => { this.setState({showLoading: true}); - const timeout = z.util.TimeUtil.UNITS_IN_MILLIS.SECOND; - this.loadingTimeout = window.setTimeout(this.resetLoadingSpinner.bind(this), timeout); + this.loadingTimeout = window.setTimeout(this.resetLoadingSpinner.bind(this), 1000); return Promise.resolve() .then(() => this.props.doRemoveClient(clientId, password)) .then(() => { From a304cade3789cb981cf36247950516dcd1082670 Mon Sep 17 00:00:00 2001 From: Michael Koppen Date: Wed, 27 Jun 2018 15:25:07 +0200 Subject: [PATCH 75/99] fix: Distinguish login and registration password field on validation (#3838) --- app/script/auth/module/action/ValidationError.js | 1 + app/script/auth/page/Login.js | 2 +- app/script/strings.js | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/script/auth/module/action/ValidationError.js b/app/script/auth/module/action/ValidationError.js index 09c1ca9e34f..e2ad147608f 100644 --- a/app/script/auth/module/action/ValidationError.js +++ b/app/script/auth/module/action/ValidationError.js @@ -71,6 +71,7 @@ export default class ValidationError extends Error { EMAIL: {...ValidationError.mapErrorsToField('email'), name: 'email'}, NAME: {...ValidationError.mapErrorsToField('name'), name: 'name'}, PASSWORD: {...ValidationError.mapErrorsToField('password'), name: 'password'}, + PASSWORD_LOGIN: {...ValidationError.mapErrorsToField('password-login'), name: 'password-login'}, }; static getFieldByName = fieldName => { diff --git a/app/script/auth/page/Login.js b/app/script/auth/page/Login.js index a63ba15bf48..9c58aba6fff 100644 --- a/app/script/auth/page/Login.js +++ b/app/script/auth/page/Login.js @@ -288,7 +288,7 @@ class Login extends React.PureComponent { /> this.setState({ diff --git a/app/script/strings.js b/app/script/strings.js index 850ed1a6272..c969a0481cd 100644 --- a/app/script/strings.js +++ b/app/script/strings.js @@ -498,6 +498,10 @@ export const validationErrorStrings = defineMessages({ id: 'ValidationError.FIELD.PASSWORD.PATTERN_MISMATCH', defaultMessage: 'Enter a password with at least 8 characters', }, + [ValidationError.FIELD.PASSWORD_LOGIN.PATTERN_MISMATCH]: { + id: 'ValidationError.FIELD.PASSWORD_LOGIN.PATTERN_MISMATCH', + defaultMessage: 'Wrong password. Please try again.', + }, [ValidationError.FIELD.EMAIL.TYPE_MISMATCH]: { id: 'ValidationError.FIELD.EMAIL.TYPE_MISMATCH', defaultMessage: 'Please enter a valid email address', From a8c5f905d7e263fe695446f2517bd95d033f5150 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 15:36:44 +0200 Subject: [PATCH 76/99] chore: Increase required Firefox to ESR version 60 (#3841) --- aws/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/config.py b/aws/config.py index 8194481dba6..fd869e628f5 100644 --- a/aws/config.py +++ b/aws/config.py @@ -28,7 +28,7 @@ SUPPORTED = { 'chrome': 56, - 'firefox': 52, + 'firefox': 60, 'opera': 43, 'msedge': 15, } From 5fc7d09e313f592b8fde3063078bca29e7faddd6 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 15:40:43 +0200 Subject: [PATCH 77/99] feat: Rely on IntersectionObserver for avatar viewport check (#3840) --- app/script/components/participantAvatar.js | 45 ++++++++++++++-------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/app/script/components/participantAvatar.js b/app/script/components/participantAvatar.js index 3aa4e471688..8908a97a602 100644 --- a/app/script/components/participantAvatar.js +++ b/app/script/components/participantAvatar.js @@ -97,10 +97,10 @@ z.components.ParticipantAvatar = class ParticipantAvatar { if (this.isService()) { return ''; } - if (this.element.hasClass('avatar-xs')) { - return z.util.StringUtil.getFirstChar(this.participant().initials()); - } - return this.participant().initials(); + + return this.element.hasClass('avatar-xs') + ? z.util.StringUtil.getFirstChar(this.participant().initials()) + : this.participant().initials(); }); this.state = ko.pureComputed(() => { @@ -130,10 +130,10 @@ z.components.ParticipantAvatar = class ParticipantAvatar { if (this.isService()) { return 'accent-color-bot'; } - if (this.isTemporaryGuest()) { - return 'accent-color-temporary'; - } - return `accent-color-${this.participant().accent_id()} ${this.state()}`; + + return this.isTemporaryGuest() + ? 'accent-color-temporary' + : `accent-color-${this.participant().accent_id()} ${this.state()}`; }); this.onClick = (data, event) => { @@ -142,13 +142,24 @@ z.components.ParticipantAvatar = class ParticipantAvatar { } }; - this.onInViewport = () => { - this.avatarEnteredViewport = true; - this._loadAvatarPicture(); - return true; + const _createObserver = element => { + const onIntersect = (entries, intersectionObserver) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + this.avatarEnteredViewport = true; + _loadAvatarPicture(); + intersectionObserver.disconnect(); + } + }); + }; + + const options = {root: null, rootMargin: '0px', threshold: 0.0}; + const intersectionObserver = new IntersectionObserver(onIntersect, options); + intersectionObserver.observe(element); + return intersectionObserver; }; - this._loadAvatarPicture = () => { + const _loadAvatarPicture = () => { this.element.find('.avatar-image').html(''); this.element.removeClass('avatar-image-loaded avatar-loading-transition'); if (!this.avatarLoadingBlocked) { @@ -176,14 +187,16 @@ z.components.ParticipantAvatar = class ParticipantAvatar { this.picturePreviewSubscription = this.participant().previewPictureResource.subscribe(() => { if (this.avatarEnteredViewport) { - this._loadAvatarPicture(); + _loadAvatarPicture(); } }); - this.participantSubscription = this.participant.subscribe(() => this._loadAvatarPicture()); + this.participantSubscription = this.participant.subscribe(() => _loadAvatarPicture()); + this.intersectionObserver = _createObserver(componentInfo.element); } dispose() { + this.intersectionObserver.disconnect(); this.participantSubscription.dispose(); this.picturePreviewSubscription.dispose(); } @@ -191,7 +204,7 @@ z.components.ParticipantAvatar = class ParticipantAvatar { ko.components.register('participant-avatar', { template: ` -
+
From 3c31535e86971095690f1c1df4042e17a4c7e736 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 27 Jun 2018 16:12:27 +0200 Subject: [PATCH 78/99] chore: Update @wireapp/react-ui-kit to version 1.4.2 (#3844) --- package.json | 2 +- yarn.lock | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index de0e550ad80..b03a100d61f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", "@wireapp/core": "3.6.3", - "@wireapp/react-ui-kit": "1.4.1", + "@wireapp/react-ui-kit": "1.4.2", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", "dexie-batch": "ffflorian/dexie-batch#dbf3b4dd9c24066a5ad11d875566ef61ffa53150", diff --git a/yarn.lock b/yarn.lock index b6597b9dd79..e4931bfa1ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -571,11 +571,11 @@ ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" -"@wireapp/react-ui-kit@1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.4.1.tgz#be88bc23186d3343d5ec0243bf0142b5611b500e" +"@wireapp/react-ui-kit@1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@wireapp/react-ui-kit/-/react-ui-kit-1.4.2.tgz#043105f4100545016f5a1dffd5014adefb9ed8dd" dependencies: - bazinga64 "5.2.6" + bazinga64 "5.2.7" color "3.0.0" react "16.4.1" react-dom "16.4.1" @@ -1699,6 +1699,10 @@ bazinga64@5.2.6: version "5.2.6" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.6.tgz#a8c374fd5e0ae9d8cbb31ebe77fa797ef1b0d7ed" +bazinga64@5.2.7: + version "5.2.7" + resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.7.tgz#7532791143167d07eac45ae8df7539bfa8177dec" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" From 50581f7c740d0e10a4e25d9a673252a5dca14de3 Mon Sep 17 00:00:00 2001 From: Michael Koppen Date: Wed, 27 Jun 2018 16:25:53 +0200 Subject: [PATCH 79/99] fix: Trim email input on login (#3842) --- app/script/auth/page/Login.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/script/auth/page/Login.js b/app/script/auth/page/Login.js index 9c58aba6fff..a31701c4be5 100644 --- a/app/script/auth/page/Login.js +++ b/app/script/auth/page/Login.js @@ -172,7 +172,8 @@ class Login extends React.PureComponent { } }) .then(() => { - const {email, password, persist} = this.state; + const {password, persist} = this.state; + const email = this.state.email.trim(); const login = {clientType: persist ? ClientType.PERMANENT : ClientType.TEMPORARY, password}; if (this.isValidEmail(email)) { From eb8bada45614b6c8f97c0b486e4596ed90d9b201 Mon Sep 17 00:00:00 2001 From: Thomas Belin Date: Wed, 27 Jun 2018 16:27:43 +0200 Subject: [PATCH 80/99] fix: Keeps track of the pie's animation state (WEBAPP-5209) (#3847) --- app/script/components/ephemeralTimer.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/script/components/ephemeralTimer.js b/app/script/components/ephemeralTimer.js index ea9f8ad33d3..f612dad2473 100644 --- a/app/script/components/ephemeralTimer.js +++ b/app/script/components/ephemeralTimer.js @@ -25,13 +25,20 @@ window.z.components = z.components || {}; z.components.EphemeralTimer = class EphemeralTimer { constructor({message: messageEntity}, componentInfo) { const duration = messageEntity.ephemeral_expires() - messageEntity.ephemeral_started(); + const dashLength = 12.6; + const dial = componentInfo.element.querySelector('.ephemeral-timer__dial'); - this.remainingTime = messageEntity.ephemeral_expires() - Date.now(); - this.initialDashOffset = dashLength - (this.remainingTime / duration) * -dashLength; + const animatePie = () => { + const remainingTime = messageEntity.ephemeral_expires() - Date.now(); + dial.style.strokeDashoffset = dashLength - (remainingTime / duration) * -dashLength; + this.animationFrameCallback = window.requestAnimationFrame(animatePie); + }; + this.animationFrameCallback = window.requestAnimationFrame(animatePie); + } - const dial = componentInfo.element.querySelector('.ephemeral-timer__dial'); - z.util.afterRender(() => (dial.style.strokeDashoffset = dashLength)); + dispose() { + window.cancelAnimationFrame(this.animationFrameCallback); } }; @@ -39,7 +46,7 @@ ko.components.register('ephemeral-timer', { template: ` - + `, From eee3816d04600c92f250fdfea5d4fb18b6187bae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 27 Jun 2018 16:32:41 +0200 Subject: [PATCH 81/99] chore: Update @wireapp/core to version 3.6.5 (#3846) --- package.json | 2 +- yarn.lock | 74 +++++++++++++++++++++++++--------------------------- 2 files changed, 36 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index b03a100d61f..37f464c5251 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@bower_components/webrtc-adapter": "webrtc/adapter#6.2.1", "@bower_components/wire-audio-files": "wireapp/wire-audio-files#1.1.1", "@bower_components/wire-theme": "wireapp/wire-theme#1.0.6", - "@wireapp/core": "3.6.3", + "@wireapp/core": "3.6.5", "@wireapp/react-ui-kit": "1.4.2", "babel-plugin-react-intl": "2.4.0", "babel-polyfill": "6.26.0", diff --git a/yarn.lock b/yarn.lock index e4931bfa1ee..2c42a039dc9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -503,15 +503,15 @@ "@webassemblyjs/wast-parser" "1.5.12" long "^3.2.0" -"@wireapp/api-client@1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.4.2.tgz#086a3f25d7398f19cc4754ca185e32e31fbee93f" +"@wireapp/api-client@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@wireapp/api-client/-/api-client-1.5.0.tgz#3a8901868c4d838c8c1eacecd48f8fb24fbd1e0a" dependencies: "@types/node" "10.3.6" "@types/spark-md5" "3.0.0" "@types/tough-cookie" "2.3.3" - "@wireapp/priority-queue" "0.1.50" - "@wireapp/store-engine" "0.11.35" + "@wireapp/priority-queue" "0.1.51" + "@wireapp/store-engine" "0.11.36" axios "0.18.0" html5-websocket "2.0.3" logdown "3.2.3" @@ -519,55 +519,55 @@ spark-md5 "3.0.0" tough-cookie "2.4.3" -"@wireapp/cbor@3.0.52": - version "3.0.52" - resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.52.tgz#4d6857cf2cbc1257e8d23ebdc26268791245b3b9" +"@wireapp/cbor@3.0.53": + version "3.0.53" + resolved "https://registry.yarnpkg.com/@wireapp/cbor/-/cbor-3.0.53.tgz#40b0b15441fd3a484a11f31379192f8bf0276e28" -"@wireapp/core@3.6.3": - version "3.6.3" - resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.6.3.tgz#79b51db99a06364a945da1832e699de5b08c6066" +"@wireapp/core@3.6.5": + version "3.6.5" + resolved "https://registry.yarnpkg.com/@wireapp/core/-/core-3.6.5.tgz#3249ec83238ebfba983657f0b3d1ac29682dd135" dependencies: "@types/node" "10.3.6" - "@wireapp/api-client" "1.4.2" - "@wireapp/cryptobox" "8.5.3" - "@wireapp/store-engine" "0.11.35" - bazinga64 "5.2.6" + "@wireapp/api-client" "1.5.0" + "@wireapp/cryptobox" "8.5.4" + "@wireapp/store-engine" "0.11.36" + bazinga64 "5.2.7" logdown "3.2.3" protobufjs "6.8.6" pure-uuid "1.5.3" -"@wireapp/cryptobox@8.5.3": - version "8.5.3" - resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.5.3.tgz#b618e2d916578b39a30c49cf447e7f43208807b3" +"@wireapp/cryptobox@8.5.4": + version "8.5.4" + resolved "https://registry.yarnpkg.com/@wireapp/cryptobox/-/cryptobox-8.5.4.tgz#225900ac0fc69c09f613f5d6a72849403b3891e3" dependencies: "@types/fs-extra" "5.0.3" "@types/node" "10.3.6" - "@wireapp/lru-cache" "2.1.29" - "@wireapp/priority-queue" "0.1.50" - "@wireapp/proteus" "7.2.2" - "@wireapp/store-engine" "0.11.35" + "@wireapp/lru-cache" "2.1.30" + "@wireapp/priority-queue" "0.1.51" + "@wireapp/proteus" "7.2.3" + "@wireapp/store-engine" "0.11.36" dexie "2.0.4" fs-extra "6.0.1" -"@wireapp/lru-cache@2.1.29": - version "2.1.29" - resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.29.tgz#812371aeefc438e8625b633834c73162539fcf30" +"@wireapp/lru-cache@2.1.30": + version "2.1.30" + resolved "https://registry.yarnpkg.com/@wireapp/lru-cache/-/lru-cache-2.1.30.tgz#08881e86e3e0d04cd733fbab8b7022b038afdaf3" -"@wireapp/priority-queue@0.1.50": - version "0.1.50" - resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.50.tgz#eaf6a2f8af6c56f5475ac31c403ba95b7ddf7a5f" +"@wireapp/priority-queue@0.1.51": + version "0.1.51" + resolved "https://registry.yarnpkg.com/@wireapp/priority-queue/-/priority-queue-0.1.51.tgz#0d593ce98cf48af295f4bcccfc5f403bf1d3da13" dependencies: "@types/node" "10.3.6" pure-uuid "1.5.3" -"@wireapp/proteus@7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.2.2.tgz#f872996bfe9ae48df1293daba6f3797af46200be" +"@wireapp/proteus@7.2.3": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@wireapp/proteus/-/proteus-7.2.3.tgz#333c136fd3820504716140d3c74028455f3220b6" dependencies: "@types/chai" "4.1.4" "@types/ed2curve" "0.2.2" "@types/node" "10.3.6" - "@wireapp/cbor" "3.0.52" + "@wireapp/cbor" "3.0.53" ed2curve "0.2.1" libsodium-wrappers-sumo "0.7.3" @@ -583,9 +583,9 @@ styled-components "3.3.3" styled-normalize "8.0.0" -"@wireapp/store-engine@0.11.35": - version "0.11.35" - resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.35.tgz#781bce1cc8ff0ad6dcc2c5afbc2589b1cb59a1ed" +"@wireapp/store-engine@0.11.36": + version "0.11.36" + resolved "https://registry.yarnpkg.com/@wireapp/store-engine/-/store-engine-0.11.36.tgz#1c28775080b670b97c739fd1014182e16b13e2d5" dependencies: "@types/filesystem" "0.0.28" "@types/node" "10.3.6" @@ -1695,10 +1695,6 @@ batch@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" -bazinga64@5.2.6: - version "5.2.6" - resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.6.tgz#a8c374fd5e0ae9d8cbb31ebe77fa797ef1b0d7ed" - bazinga64@5.2.7: version "5.2.7" resolved "https://registry.yarnpkg.com/bazinga64/-/bazinga64-5.2.7.tgz#7532791143167d07eac45ae8df7539bfa8177dec" From e57211905d1b0b34947d4d94382a2a61f32979ac Mon Sep 17 00:00:00 2001 From: Thomas Belin Date: Wed, 27 Jun 2018 16:55:01 +0200 Subject: [PATCH 82/99] fix: do not mutate the messages list in conversation (#3848) --- app/script/entity/Conversation.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/script/entity/Conversation.js b/app/script/entity/Conversation.js index 2648c89b89c..810e2675a5d 100644 --- a/app/script/entity/Conversation.js +++ b/app/script/entity/Conversation.js @@ -570,11 +570,13 @@ z.entity.Conversation = class Conversation { * @returns {z.entity.Message} Last delivered message */ getLastDeliveredMessage() { - const messageEntities = this.messages().reverse(); - return messageEntities.find(messageEntity => { - const isDelivered = messageEntity.status() === z.message.StatusType.DELIVERED; - return isDelivered && messageEntity.user().is_me; - }); + return this.messages() + .slice() + .reverse() + .find(messageEntity => { + const isDelivered = messageEntity.status() === z.message.StatusType.DELIVERED; + return isDelivered && messageEntity.user().is_me; + }); } /** From 640a3a1d79a4ecd1453229aa0f9d678eaa3293fb Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 18:26:36 +0200 Subject: [PATCH 83/99] refactor: Use single in viewport observer (#3850) --- app/page/template/_dist/app.htm | 1 + app/script/components/participantAvatar.js | 27 +++----- app/script/ui/ViewportObserver.js | 72 ++++++++++++++++++++++ 3 files changed, 81 insertions(+), 19 deletions(-) create mode 100644 app/script/ui/ViewportObserver.js diff --git a/app/page/template/_dist/app.htm b/app/page/template/_dist/app.htm index 5b7dab8f5c3..23a0ff45d47 100644 --- a/app/page/template/_dist/app.htm +++ b/app/page/template/_dist/app.htm @@ -412,5 +412,6 @@ + diff --git a/app/script/components/participantAvatar.js b/app/script/components/participantAvatar.js index 8908a97a602..6e65a854c58 100644 --- a/app/script/components/participantAvatar.js +++ b/app/script/components/participantAvatar.js @@ -142,23 +142,6 @@ z.components.ParticipantAvatar = class ParticipantAvatar { } }; - const _createObserver = element => { - const onIntersect = (entries, intersectionObserver) => { - entries.forEach(entry => { - if (entry.isIntersecting) { - this.avatarEnteredViewport = true; - _loadAvatarPicture(); - intersectionObserver.disconnect(); - } - }); - }; - - const options = {root: null, rootMargin: '0px', threshold: 0.0}; - const intersectionObserver = new IntersectionObserver(onIntersect, options); - intersectionObserver.observe(element); - return intersectionObserver; - }; - const _loadAvatarPicture = () => { this.element.find('.avatar-image').html(''); this.element.removeClass('avatar-image-loaded avatar-loading-transition'); @@ -185,6 +168,13 @@ z.components.ParticipantAvatar = class ParticipantAvatar { } }; + const _onInViewPort = () => { + this.avatarEnteredViewport = true; + _loadAvatarPicture(); + }; + + z.ui.ViewportObserver.addElement(componentInfo.element, _onInViewPort); + this.picturePreviewSubscription = this.participant().previewPictureResource.subscribe(() => { if (this.avatarEnteredViewport) { _loadAvatarPicture(); @@ -192,11 +182,10 @@ z.components.ParticipantAvatar = class ParticipantAvatar { }); this.participantSubscription = this.participant.subscribe(() => _loadAvatarPicture()); - this.intersectionObserver = _createObserver(componentInfo.element); } dispose() { - this.intersectionObserver.disconnect(); + z.ui.ViewportObserver.removeElement(this.element[0]); this.participantSubscription.dispose(); this.picturePreviewSubscription.dispose(); } diff --git a/app/script/ui/ViewportObserver.js b/app/script/ui/ViewportObserver.js new file mode 100644 index 00000000000..c090bf17d61 --- /dev/null +++ b/app/script/ui/ViewportObserver.js @@ -0,0 +1,72 @@ +/* + * Wire + * Copyright (C) 2018 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + * + */ + +'use strict'; + +window.z = window.z || {}; +window.z.ui = z.ui || {}; + +z.ui.ViewportObserver = (() => { + let intersectionObserver = undefined; + const observedElements = []; + + const _addElement = (element, callback) => { + if (!intersectionObserver) { + _createObserver(); + } + observedElements.push({callback, element}); + intersectionObserver.observe(element); + }; + + const _createObserver = () => { + const onIntersect = entries => { + entries.forEach(entry => { + if (entry.isIntersecting) { + const trackedElement = _getObservedElement(entry.target); + trackedElement.callback(); + intersectionObserver.unobserve(trackedElement.element); + _removeObservedElement(trackedElement); + } + }); + }; + + const options = {root: null, rootMargin: '0px', threshold: 0.0}; + intersectionObserver = new IntersectionObserver(onIntersect, options); + return intersectionObserver; + }; + + const _getObservedElement = requestedElement => observedElements.find(({element}) => element === requestedElement); + + const _removeElement = element => { + const observedElement = _getObservedElement(element); + if (observedElement) { + _removeObservedElement(observedElement); + } + intersectionObserver.unobserve(element); + }; + + const _removeObservedElement = observedElement => { + observedElements.splice(observedElements.indexOf(observedElement), 1); + }; + + return { + addElement: _addElement, + removeElement: _removeElement, + }; +})(); From 6071ec4f696510a76ab507baf58008d7755a0a0d Mon Sep 17 00:00:00 2001 From: Thomas Belin Date: Wed, 27 Jun 2018 18:43:55 +0200 Subject: [PATCH 84/99] fix: limits pie animation rate depending on total duration (#3849) --- app/script/components/ephemeralTimer.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/script/components/ephemeralTimer.js b/app/script/components/ephemeralTimer.js index f612dad2473..6374d4f3b91 100644 --- a/app/script/components/ephemeralTimer.js +++ b/app/script/components/ephemeralTimer.js @@ -29,16 +29,22 @@ z.components.EphemeralTimer = class EphemeralTimer { const dashLength = 12.6; const dial = componentInfo.element.querySelector('.ephemeral-timer__dial'); + const numberOfAnimationSteps = 40; + const animationIntervalValue = Math.min(duration / numberOfAnimationSteps, z.util.TimeUtil.UNITS_IN_MILLIS.HOUR); const animatePie = () => { const remainingTime = messageEntity.ephemeral_expires() - Date.now(); - dial.style.strokeDashoffset = dashLength - (remainingTime / duration) * -dashLength; - this.animationFrameCallback = window.requestAnimationFrame(animatePie); + const newDashoffset = dashLength - (remainingTime / duration) * -dashLength; + dial.style.strokeDashoffset = Math.max(newDashoffset, dashLength); + if (newDashoffset === dashLength) { + window.clearInterval(this.animationInterval); + this.animationInterval = undefined; + } }; - this.animationFrameCallback = window.requestAnimationFrame(animatePie); + this.animationInterval = window.setInterval(animatePie, animationIntervalValue); } dispose() { - window.cancelAnimationFrame(this.animationFrameCallback); + window.clearInterval(this.animationInterval); } }; From 840bb75e8ae94ffebf65edc55533cf4d91a9dbac Mon Sep 17 00:00:00 2001 From: Benny Neugebauer Date: Wed, 27 Jun 2018 19:07:20 +0200 Subject: [PATCH 85/99] chore: Prevent unsanitized HTML (#3843) --- .eslintrc.json | 4 ++-- package.json | 1 + yarn.lock | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 0771f9ae505..80a1dde3f9c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,7 @@ "jasmine": true, "node": true }, - "extends": ["plugin:react/recommended", "prettier"], + "extends": ["plugin:no-unsanitized/DOM", "plugin:react/recommended", "prettier"], "globals": { "$": true, "_": true, @@ -45,7 +45,7 @@ "z": true, "zeta": true }, - "plugins": ["jsdoc", "prettier", "react"], + "plugins": ["jsdoc", "no-unsanitized", "prettier", "react"], "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 6, diff --git a/package.json b/package.json index 37f464c5251..2e1b8ffc6bf 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "eslint-config-prettier": "2.9.0", "eslint-plugin-babel": "5.1.0", "eslint-plugin-jsdoc": "3.7.1", + "eslint-plugin-no-unsanitized": "3.0.2", "eslint-plugin-prettier": "2.6.1", "eslint-plugin-react": "7.7.0", "grunt": "1.0.3", diff --git a/yarn.lock b/yarn.lock index 2c42a039dc9..2cb5eba5cc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3578,6 +3578,10 @@ eslint-plugin-jsdoc@3.7.1: jsdoctypeparser "^2.0.0-alpha-8" lodash "^4.17.4" +eslint-plugin-no-unsanitized@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-3.0.2.tgz#83c6fcf8e34715112757e03dd4ee436dce29ed45" + eslint-plugin-prettier@2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.1.tgz#de902b4a66b7bca24296429a59a1cc04020ccbbd" From 6a137303638723cc917fdcee424cabb3dbdb2146 Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 19:22:29 +0200 Subject: [PATCH 86/99] refactor: Rely on IntersectionObserver for on in viewport check of images (#3851) --- app/script/components/image.js | 43 +++++++++++----------- app/script/components/participantAvatar.js | 4 +- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/app/script/components/image.js b/app/script/components/image.js index de42b186463..51ba990e151 100644 --- a/app/script/components/image.js +++ b/app/script/components/image.js @@ -23,54 +23,53 @@ window.z = window.z || {}; window.z.components = z.components || {}; z.components.Image = class Image { - constructor(params) { + constructor(params, componentInfo) { this.asset = ko.unwrap(params.asset); - this.asset_src = ko.observable(); - this.asset_is_loading = ko.observable(false); + this.assetSrc = ko.observable(); + this.assetIsLoading = ko.observable(false); + this.element = componentInfo.element; - this.on_click = () => { - if (!this.asset_is_loading() && typeof params.click === 'function') { + this.onClick = () => { + if (!this.assetIsLoading() && typeof params.click === 'function') { params.click(this.asset); } }; - this.on_entered_viewport = () => { - this.load_image_asset(); - return true; - }; - - this.load_image_asset = () => { - this.asset_is_loading(true); + const _onInViewport = () => { + this.assetIsLoading(true); this.asset.load().then(blob => { if (blob) { - this.asset_src(window.URL.createObjectURL(blob)); + this.assetSrc(window.URL.createObjectURL(blob)); } - this.asset_is_loading(false); + this.assetIsLoading(false); }); }; + + z.ui.ViewportObserver.addElement(this.element, _onInViewport); } dispose() { - if (this.asset_src()) { - window.URL.revokeObjectURL(this.asset_src()); + z.ui.ViewportObserver.removeElement(this.element); + if (this.assetSrc()) { + window.URL.revokeObjectURL(this.assetSrc()); } } }; ko.components.register('image-component', { template: ` - - + + - -
+ +
`, viewModel: { - createViewModel(params, component_info) { - return new z.components.Image(params, component_info); + createViewModel(params, componentInfo) { + return new z.components.Image(params, componentInfo); }, }, }); diff --git a/app/script/components/participantAvatar.js b/app/script/components/participantAvatar.js index 6e65a854c58..f093f4a03a3 100644 --- a/app/script/components/participantAvatar.js +++ b/app/script/components/participantAvatar.js @@ -168,12 +168,12 @@ z.components.ParticipantAvatar = class ParticipantAvatar { } }; - const _onInViewPort = () => { + const _onInViewport = () => { this.avatarEnteredViewport = true; _loadAvatarPicture(); }; - z.ui.ViewportObserver.addElement(componentInfo.element, _onInViewPort); + z.ui.ViewportObserver.addElement(componentInfo.element, _onInViewport); this.picturePreviewSubscription = this.participant().previewPictureResource.subscribe(() => { if (this.avatarEnteredViewport) { From 8003bae26594b77d5ced6a196b1c89c3c6bfb61f Mon Sep 17 00:00:00 2001 From: Gregor Herdmann Date: Wed, 27 Jun 2018 20:29:28 +0200 Subject: [PATCH 87/99] refactor: Cleanup of foreach bindings (#3853) --- app/page/login.html | 18 +++---- .../template/content/collection-details.htm | 32 ++++++------- app/page/template/content/collection.htm | 24 ++++------ app/page/template/list/archive.htm | 18 ++++--- app/page/template/panel/timed-messages.htm | 48 +++++++++---------- .../template/partials/template-message.htm | 14 +++--- app/script/components/calling/chooseScreen.js | 10 ++-- .../components/calling/deviceToggleButton.js | 6 +-- app/script/components/inputLevel.js | 6 +-- app/script/components/list/groupAvatar.js | 6 +-- 10 files changed, 77 insertions(+), 105 deletions(-) diff --git a/app/page/login.html b/app/page/login.html index ed52efbd9e8..16497092527 100644 --- a/app/page/login.html +++ b/app/page/login.html @@ -57,10 +57,8 @@ data-uie-name="enter-phone">
-
    - -
  • - +
      +
    @@ -91,10 +89,8 @@ data-bind="css: {'input-error': failed_validation_password}, event: {input: clear_error_password}, l10n_tooltip: z.string.authPlaceholderPasswordSet, l10n_placeholder: z.string.authPlaceholderPasswordSet, textInput: password" data-uie-name="enter-password">
    -
      - -
    • - +
        +