From a5b44be6a1687ffe53b85a3b4651ad097008d17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Mon, 9 Aug 2021 16:37:24 +0200 Subject: [PATCH 1/8] Update JWT expires days (#1349) --- pusher/src/Services/JWTTokenManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pusher/src/Services/JWTTokenManager.ts b/pusher/src/Services/JWTTokenManager.ts index 9a7c2695..bb21531c 100644 --- a/pusher/src/Services/JWTTokenManager.ts +++ b/pusher/src/Services/JWTTokenManager.ts @@ -11,7 +11,8 @@ export const tokenInvalidException = "tokenInvalid"; class JWTTokenManager { public createAuthToken(identifier: string) { - return Jwt.sign({ identifier }, SECRET_KEY, { expiresIn: "3d" }); + //TODO fix me 200d when ory authentication will be available + return Jwt.sign({ identifier }, SECRET_KEY, { expiresIn: "200d" }); } public decodeJWTToken(token: string): AuthTokenData { From 1db2e2aba988c0e1c478f4de5bd9479dc5067a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Tue, 10 Aug 2021 10:12:31 +0200 Subject: [PATCH 2/8] Update style of microphone (#1352) - Active microphone close when user haven't microphone in the discussion --- front/src/Components/Video/VideoMediaBox.svelte | 2 +- front/style/style.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/front/src/Components/Video/VideoMediaBox.svelte b/front/src/Components/Video/VideoMediaBox.svelte index d46f3ca7..cc7fb424 100644 --- a/front/src/Components/Video/VideoMediaBox.svelte +++ b/front/src/Components/Video/VideoMediaBox.svelte @@ -31,7 +31,7 @@ {name} {/if} {#if $constraintStore && $constraintStore.audio === false} - Muted + Muted {/if} - + {#if $constraintStore && $constraintStore.audio !== false} diff --git a/front/src/Stores/MediaStore.ts b/front/src/Stores/MediaStore.ts index 10e4523d..8e70a1af 100644 --- a/front/src/Stores/MediaStore.ts +++ b/front/src/Stores/MediaStore.ts @@ -576,3 +576,8 @@ localStreamStore.subscribe((streamResult) => { } } }); + +/** + * A store containing the real active media is mobile + */ +export const obtainedMediaConstraintIsMobileStore = writable(false); diff --git a/front/src/WebRtc/ScreenSharingPeer.ts b/front/src/WebRtc/ScreenSharingPeer.ts index 18810182..1bb8cdcc 100644 --- a/front/src/WebRtc/ScreenSharingPeer.ts +++ b/front/src/WebRtc/ScreenSharingPeer.ts @@ -5,6 +5,7 @@ import type { UserSimplePeerInterface } from "./SimplePeer"; import { Readable, readable } from "svelte/store"; import { videoFocusStore } from "../Stores/VideoFocusStore"; import { getIceServersConfig } from "../Components/Video/utils"; +import { isMobile } from "../Enum/EnvironmentVariable"; const Peer: SimplePeerNamespace.SimplePeer = require("simple-peer"); @@ -175,6 +176,8 @@ export class ScreenSharingPeer extends Peer { public stopPushingScreenSharingToRemoteUser(stream: MediaStream) { this.removeStream(stream); - this.write(new Buffer(JSON.stringify({ type: MESSAGE_TYPE_CONSTRAINT, streamEnded: true }))); + this.write( + new Buffer(JSON.stringify({ type: MESSAGE_TYPE_CONSTRAINT, streamEnded: true, isMobile: isMobile() })) + ); } } diff --git a/front/src/WebRtc/SimplePeer.ts b/front/src/WebRtc/SimplePeer.ts index 510918a2..04075df2 100644 --- a/front/src/WebRtc/SimplePeer.ts +++ b/front/src/WebRtc/SimplePeer.ts @@ -13,6 +13,7 @@ import { screenSharingLocalStreamStore } from "../Stores/ScreenSharingStore"; import { discussionManager } from "./DiscussionManager"; import { playersStore } from "../Stores/PlayersStore"; import { newChatMessageStore } from "../Stores/ChatStore"; +import { isMobile } from "../Enum/EnvironmentVariable"; export interface UserSimplePeerInterface { userId: number; @@ -391,7 +392,13 @@ export class SimplePeer { } PeerConnection.write( - new Buffer(JSON.stringify({ type: MESSAGE_TYPE_CONSTRAINT, ...streamResult.constraints })) + new Buffer( + JSON.stringify({ + type: MESSAGE_TYPE_CONSTRAINT, + ...streamResult.constraints, + isMobile: isMobile(), + }) + ) ); if (streamResult.type === "error") { diff --git a/front/src/WebRtc/VideoPeer.ts b/front/src/WebRtc/VideoPeer.ts index aee3f735..bdf8ec16 100644 --- a/front/src/WebRtc/VideoPeer.ts +++ b/front/src/WebRtc/VideoPeer.ts @@ -5,10 +5,11 @@ import { blackListManager } from "./BlackListManager"; import type { Subscription } from "rxjs"; import type { UserSimplePeerInterface } from "./SimplePeer"; import { get, readable, Readable, Unsubscriber } from "svelte/store"; -import { obtainedMediaConstraintStore } from "../Stores/MediaStore"; +import { obtainedMediaConstraintIsMobileStore, obtainedMediaConstraintStore } from "../Stores/MediaStore"; import { playersStore } from "../Stores/PlayersStore"; import { chatMessagesStore, chatVisibilityStore, newChatMessageStore } from "../Stores/ChatStore"; import { getIceServersConfig } from "../Components/Video/utils"; +import { isMobile } from "../Enum/EnvironmentVariable"; const Peer: SimplePeerNamespace.SimplePeer = require("simple-peer"); @@ -167,6 +168,9 @@ export class VideoPeer extends Peer { } else { mediaManager.disabledVideoByUserId(this.userId); } + if (message.isMobile != undefined) { + obtainedMediaConstraintIsMobileStore.set(message.isMobile); + } } else if (message.type === MESSAGE_TYPE_MESSAGE) { if (!blackListManager.isBlackListed(this.userUuid)) { chatMessagesStore.addExternalMessage(this.userId, message.message); @@ -281,7 +285,13 @@ export class VideoPeer extends Peer { private pushVideoToRemoteUser(localStream: MediaStream | null) { try { this.write( - new Buffer(JSON.stringify({ type: MESSAGE_TYPE_CONSTRAINT, ...get(obtainedMediaConstraintStore) })) + new Buffer( + JSON.stringify({ + type: MESSAGE_TYPE_CONSTRAINT, + ...get(obtainedMediaConstraintStore), + isMobile: isMobile(), + }) + ) ); if (!localStream) { diff --git a/front/style/mobile-style.scss b/front/style/mobile-style.scss index 1b37053a..7f1e770f 100644 --- a/front/style/mobile-style.scss +++ b/front/style/mobile-style.scss @@ -28,8 +28,8 @@ height: 80%; &> div { - max-height: 120px; min-width: 200px; + max-height: 21vh; } .video-container{ diff --git a/front/style/style.scss b/front/style/style.scss index 6c8574b7..9b37e122 100644 --- a/front/style/style.scss +++ b/front/style/style.scss @@ -47,6 +47,11 @@ body .message-info.warning{ height: 100%; max-height: 90vh; cursor: url('./images/cursor_pointer.png'), pointer; + + &.mobile{ + width: 100%; + height: 21vh; + } } i { From bced49557090bbad8ec4c093081a0fcf085da4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Tue, 10 Aug 2021 23:10:56 +0200 Subject: [PATCH 5/8] Add comment use service worker (#1355) --- front/src/Network/ServiceWorker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/front/src/Network/ServiceWorker.ts b/front/src/Network/ServiceWorker.ts index e75f202f..bb61c9e9 100644 --- a/front/src/Network/ServiceWorker.ts +++ b/front/src/Network/ServiceWorker.ts @@ -8,6 +8,7 @@ export class _ServiceWorker { } init() { + //Check node env and if is development, use service worker dev file if (NODE_ENV === "development") { navigator.serviceWorker .register("/service-worker-dev.js") From 434b112c65b39e393a8ccaaaf8c36e5954604fde Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Wed, 11 Aug 2021 10:01:56 +0200 Subject: [PATCH 6/8] Improve service worker store managment Signed-off-by: Gregoire Parant --- front/dist/service-worker-dev.js | 13 ++----------- front/dist/service-worker-prod.js | 2 +- front/webpack.config.ts | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/front/dist/service-worker-dev.js b/front/dist/service-worker-dev.js index 43bd0070..62963006 100644 --- a/front/dist/service-worker-dev.js +++ b/front/dist/service-worker-dev.js @@ -1,4 +1,4 @@ -let CACHE_NAME = 'workavdenture-cache-v1'; +let CACHE_NAME = 'workavdenture-cache-dev'; let urlsToCache = [ '/' ]; @@ -14,16 +14,7 @@ self.addEventListener('install', function(event) { }); self.addEventListener('fetch', (event) => { - event.respondWith( - caches.match(event.request) - .then((response) => { - return fetch(event.request).then((response) => { - //Dev service worker, just return reponse - return response; - } - ); - }) - ); + //never cache data will be stored in dev mode }); self.addEventListener('wait', function(event) { diff --git a/front/dist/service-worker-prod.js b/front/dist/service-worker-prod.js index 2cda9379..2f8d6a51 100644 --- a/front/dist/service-worker-prod.js +++ b/front/dist/service-worker-prod.js @@ -1,4 +1,4 @@ -let CACHE_NAME = 'workavdenture-cache-v1'; +let CACHE_NAME = 'workavdenture-cache-v1.2'; let urlsToCache = [ '/' ]; diff --git a/front/webpack.config.ts b/front/webpack.config.ts index 4b7fd205..39a00828 100644 --- a/front/webpack.config.ts +++ b/front/webpack.config.ts @@ -201,7 +201,7 @@ module.exports = { MAX_USERNAME_LENGTH: 8, MAX_PER_GROUP: 4, DISPLAY_TERMS_OF_USE: false, - NODE_ENV: "development", + NODE_ENV: mode, }), ], } as Configuration & WebpackDevServer.Configuration; From 45a56c2e028200921691308e3354a06e3560b82a Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Wed, 11 Aug 2021 10:09:04 +0200 Subject: [PATCH 7/8] HotFix feedback svelte continuous integration Signed-off-by: Gregoire Parant --- front/src/Components/Video/VideoMediaBox.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/Components/Video/VideoMediaBox.svelte b/front/src/Components/Video/VideoMediaBox.svelte index 88634a9f..6b981dc8 100644 --- a/front/src/Components/Video/VideoMediaBox.svelte +++ b/front/src/Components/Video/VideoMediaBox.svelte @@ -7,7 +7,7 @@ import {videoFocusStore} from "../../Stores/VideoFocusStore"; import {showReportScreenStore} from "../../Stores/ShowReportScreenStore"; import {getColorByString, srcObject} from "./utils"; - import {localStreamStore, obtainedMediaConstraintIsMobileStore} from "../../Stores/MediaStore"; + import {obtainedMediaConstraintIsMobileStore} from "../../Stores/MediaStore"; import {onDestroy} from "svelte"; export let peer: VideoPeer; From f7daf16ac5dc4a0f460c9717fb480ded6d909457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?gr=C3=A9goire=20parant?= Date: Wed, 11 Aug 2021 17:09:17 +0200 Subject: [PATCH 8/8] New version of cache management (#1365) Signed-off-by: Gregoire Parant --- front/dist/service-worker-prod.js | 2 +- front/src/Components/Video/VideoMediaBox.svelte | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/front/dist/service-worker-prod.js b/front/dist/service-worker-prod.js index 2f8d6a51..919b0b91 100644 --- a/front/dist/service-worker-prod.js +++ b/front/dist/service-worker-prod.js @@ -1,4 +1,4 @@ -let CACHE_NAME = 'workavdenture-cache-v1.2'; +let CACHE_NAME = 'workavdenture-cache-v1.4.14'; let urlsToCache = [ '/' ]; diff --git a/front/src/Components/Video/VideoMediaBox.svelte b/front/src/Components/Video/VideoMediaBox.svelte index 6b981dc8..924bb13a 100644 --- a/front/src/Components/Video/VideoMediaBox.svelte +++ b/front/src/Components/Video/VideoMediaBox.svelte @@ -22,7 +22,6 @@ let isMobile : boolean|null; const unsubscribe = obtainedMediaConstraintIsMobileStore.subscribe(value => { - console.log('unsubscribe => obtainedMediaConstraintIsMobileStore', value); isMobile = value; }); onDestroy(unsubscribe);