From 5121b956ca9f85398503f09f00637d2a6e69af2c Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 5 Apr 2024 09:02:09 -0400 Subject: [PATCH 1/3] Fix participants disappearing during focus switch (probably) I discovered that this hook was calling complete on the returned observable almost immediately when it gets mounted. This caused the call view model to never know when the application was switching focuses. At first I thought this was just because I forgot to move the call to complete to the effect's clean-up function, but even with that changed, React still calls the effect twice in strict mode. So, let's just remove the call entirely. --- src/state/useObservable.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/state/useObservable.ts b/src/state/useObservable.ts index a55a6e40..92210e34 100644 --- a/src/state/useObservable.ts +++ b/src/state/useObservable.ts @@ -1,5 +1,5 @@ /* -Copyright 2023 New Vector Ltd +Copyright 2023-2024 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,18 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { useEffect, useRef } from "react"; +import { useRef } from "react"; import { BehaviorSubject, Observable } from "rxjs"; /** * React hook that creates an Observable from a changing value. The Observable - * replays its current value upon subscription, emits whenever the value - * changes, and completes when the component is unmounted. + * replays its current value upon subscription and emits whenever the value + * changes. */ export function useObservable(value: T): Observable { const subject = useRef>(); subject.current ??= new BehaviorSubject(value); if (value !== subject.current.value) subject.current.next(value); - useEffect(() => subject.current!.complete(), []); return subject.current; } From 545034d26fb5078c87a6d33ea80594d8eaa71be3 Mon Sep 17 00:00:00 2001 From: fkwp Date: Wed, 10 Apr 2024 14:53:19 +0200 Subject: [PATCH 2/3] make build_docker job dependent on build_element_call (#2299) --- .github/workflows/docker-pr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-pr.yaml b/.github/workflows/docker-pr.yaml index 7d0d3ed1..c8ba32dc 100644 --- a/.github/workflows/docker-pr.yaml +++ b/.github/workflows/docker-pr.yaml @@ -18,6 +18,7 @@ jobs: build_docker: if: ${{ contains(github.event.pull_request.labels.*.name, 'docker build') }} + needs: build_element_call runs-on: ubuntu-latest permissions: deployments: write From 3c3150a6b62074112c0705a29120c66795fd8bdf Mon Sep 17 00:00:00 2001 From: fkwp Date: Wed, 10 Apr 2024 15:11:43 +0200 Subject: [PATCH 3/3] checkout source -> Dockerfile (#2300) * make build_docker job dependent on build_element_call * checkout source -> Dockerfile --- .github/workflows/docker-pr.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-pr.yaml b/.github/workflows/docker-pr.yaml index c8ba32dc..a7de88d7 100644 --- a/.github/workflows/docker-pr.yaml +++ b/.github/workflows/docker-pr.yaml @@ -23,6 +23,9 @@ jobs: permissions: deployments: write steps: + - name: Check it out + uses: actions/checkout@v4 + - name: 📥 Download artifact uses: actions/download-artifact@v4 with: