mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-27 20:29:09 +00:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b56bcc38c8 | |||
| c3abd0441f | |||
| 79245389ce | |||
| 3b3f992834 | |||
| a98dc1484a | |||
| dca24a1b25 | |||
| 74b791e207 | |||
| df1495c97b | |||
| c95e1c67bd | |||
| f115c83752 | |||
| ebfcb42a7d | |||
| c86a47f736 | |||
| dd6b4512c8 | |||
| f82fd4bece | |||
| edab18d94a | |||
| 636c2168be | |||
| d54e9c2ad0 | |||
| 657712d7cb | |||
| d2bfbee389 | |||
| 9ba97fd14f | |||
| be0d0927d4 | |||
| 27dce44d40 | |||
| 78acaf395e | |||
| 4e5e648730 | |||
| 924fe95d94 | |||
| e3e33c7d0a | |||
| 16ee575ff8 | |||
| e42b083f20 | |||
| 6d2c31eb0a | |||
| e9bdf173de | |||
| dd23ce817a | |||
| 1ca8f6e5ea | |||
| f98e884067 | |||
| b498926353 | |||
| 3d4dc2d631 | |||
| 1523e6aec9 | |||
| 99510c9c6a | |||
| 9f003e95f3 | |||
| 46c30b6fcd | |||
| 1533ae8a3c | |||
| 526e96797e | |||
| 8903a55008 | |||
| 2a60b49086 | |||
| aee1847303 | |||
| 6b7cd8ab2e |
@@ -8,14 +8,42 @@ and this project adheres to
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- ⬆️(agents) upgrade to python 3.14 slim
|
||||
- ⬆️(dependencies) update python dependencies
|
||||
|
||||
### Fixed
|
||||
|
||||
- 🚀(front) fix frontend build failure
|
||||
- 🐛(makefile) fix args in make test
|
||||
- 🩹(backend) fix case-insensitive email deduplication in merge command
|
||||
- 🐛(summary) support media files with bad streams #1478
|
||||
|
||||
## [1.22.0] - 2026-07-03
|
||||
|
||||
### Added
|
||||
|
||||
- ✨(frontend) cap and paginate tiles in picture-in-picture #1383
|
||||
- 📝(docs) document rebranding the favicon via a volume mount #1443
|
||||
- ✨(backend) add command to clean pending and deleted files
|
||||
- 🧱(helm) run clean files command as cronjob
|
||||
- ✨(backend) add fallback to save recordings without S3/MinIO webhooks
|
||||
- 🩹(frontend) enable screen share button in PiP #1458
|
||||
- 🐛(backend) support unencoded S3 notification object keys #1455
|
||||
|
||||
### Changed
|
||||
|
||||
- ✨(summary) generalized stt api call #1420
|
||||
- ♻️(env) refactor env variables handling
|
||||
- 🚸(frontend) use "Advanced" instead of "Premium" in the sidepanel
|
||||
- ♿️(frontend) make fullscreen share warning keyboard accessible #1459
|
||||
- ⬆️(summary) update docker alpine to 3.24 & ffmpeg to 8.1.2 #1471
|
||||
|
||||
### Fixed
|
||||
|
||||
- 🛂(backend) reject user access tokens on the API
|
||||
- 🩹(helm) fix Helm ingress rendering when passing multiple hosts
|
||||
|
||||
## [1.21.0] - 2026-06-15
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ create-env-files: \
|
||||
env.d/development/kc_postgresql \
|
||||
env.d/development/summary \
|
||||
env.d/development/kube-secret \
|
||||
env.d/development/multi_user_transcriber
|
||||
env.d/development/multi_user_transcriber \
|
||||
env.d/development/metadata_collector
|
||||
.PHONY: create-env-files
|
||||
|
||||
bootstrap: ## Prepare Docker images for the project
|
||||
@@ -210,24 +211,25 @@ lint-pylint: ## lint back-end python sources with pylint only on changed files f
|
||||
@$(COMPOSE_RUN_APP) pylint meet demo core
|
||||
.PHONY: lint-pylint
|
||||
|
||||
test: ## run project tests
|
||||
@$(MAKE) test-back-parallel
|
||||
@$(MAKE) test-summary
|
||||
test: ## run project tests; pass extra pytest args via ARGS, e.g. `make test ARGS="-vv"`
|
||||
@args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
$(MAKE) test-back-parallel ARGS="$${args}" && \
|
||||
$(MAKE) test-summary ARGS="$${args}"
|
||||
.PHONY: test
|
||||
|
||||
test-back: ## run back-end tests
|
||||
@args="$(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
bin/pytest $${args:-${1}}
|
||||
test-back: ## run back-end tests (pass extra pytest args via ARGS)
|
||||
@args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
bin/pytest $${args}
|
||||
.PHONY: test-back
|
||||
|
||||
test-back-parallel: ## run all back-end tests in parallel
|
||||
@args="$(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
bin/pytest -n auto $${args:-${1}}
|
||||
test-back-parallel: ## run all back-end tests in parallel (pass extra pytest args via ARGS)
|
||||
@args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
bin/pytest -n auto $${args}
|
||||
.PHONY: test-back-parallel
|
||||
|
||||
test-summary: ## run summary tests
|
||||
@args="$(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
bin/pytest-summary $${args:-${1}}
|
||||
test-summary: ## run summary tests (pass extra pytest args via ARGS)
|
||||
@args="$(ARGS) $(filter-out $@,$(MAKECMDGOALS))" && \
|
||||
bin/pytest-summary $${args}
|
||||
.PHONY: test-summary
|
||||
|
||||
makemigrations: ## run django makemigrations for the Meet project.
|
||||
@@ -292,6 +294,9 @@ env.d/development/kube-secret:
|
||||
env.d/development/multi_user_transcriber:
|
||||
cp -n env.d/development/multi_user_transcriber.dist env.d/development/multi_user_transcriber
|
||||
|
||||
env.d/development/metadata_collector:
|
||||
cp -n env.d/development/metadata_collector.dist env.d/development/metadata_collector
|
||||
|
||||
# -- Internationalization
|
||||
|
||||
env.d/development/crowdin:
|
||||
|
||||
@@ -31,6 +31,14 @@
|
||||
## La Suite Meet: Simple Video Conferencing
|
||||
|
||||
Powered by [LiveKit](https://livekit.io/), La Suite Meet offers Zoom-level performance with high-quality video and audio. No installation required—simply join calls directly from your browser. Check out LiveKit's impressive optimizations in their [blog post](https://blog.livekit.io/livekit-one-dot-zero/).
|
||||
|
||||
> [!TIP]
|
||||
> New here? Start by introducing yourself in our Matrix channel:
|
||||
> **https://matrix.to/#/#meet-official:matrix.org**
|
||||
>
|
||||
> We’re happy to discuss ideas, answer questions, and help to deploy LaSuite Meet.
|
||||
|
||||
|
||||
### Features
|
||||
- Optimized for stability in large meetings (+100 p.)
|
||||
- Support for multiple screen sharing streams
|
||||
@@ -55,7 +63,7 @@ We’re continuously adding new features to enhance your experience, with the la
|
||||
|
||||
### 🚀 Major roll out to all French public servants
|
||||
|
||||
On the 25th of January 2026, David Amiel, France’s Minister for Civil Service and State Reform, announced the full deployment of Visio—the French government’s dedicated Meet platform—to all public servants. ([Source in French](https://www.latribune.fr/article/la-tribune-dimanche/politique/73157688099661/david-amiel-ministre-delegue-de-la-fonction-publique-nous-allons-sortir-de-la-dependance-aux-outils-americains))
|
||||
On the 29th of January 2026, Prime Minister Sébastien Lecornu, announced the full deployment of Visio—the French government’s dedicated Meet platform—to all public servants. ([Source in English](https://www.nytimes.com/2026/01/29/world/europe/france-zoom-alternative-visio.html))
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -87,22 +95,57 @@ We use Kubernetes for our [production instance](https://visio.numerique.gouv.fr/
|
||||
#### Known instances
|
||||
We hope to see many more, here is an incomplete list of public La Suite Meet instances. Feel free to make a PR to add ones that are not listed below🙏
|
||||
|
||||
| Url | Org | Access |
|
||||
|---------------------------------------------------------------| --- | ------- |
|
||||
| [visio.numerique.gouv.fr](https://visio.numerique.gouv.fr/) | DINUM | French public agents working for the central administration and the extended public sphere. ProConnect is required to login in or sign up|
|
||||
| [visio.suite.anct.gouv.fr](https://visio.suite.anct.gouv.fr/) | ANCT | French public agents working for the territorial administration and the extended public sphere. ProConnect is required to login in or sign up|
|
||||
| [visio.lasuite.coop](https://visio.lasuite.coop/) | lasuite.coop | Free and open demo to all. Content and accounts are reset after one month |
|
||||
| [mosacloud.cloud](https://mosa.cloud/) | mosa.cloud | Demo instance of mosa.cloud, a dutch company providing services around La Suite apps. |
|
||||
| Url | Org | Access |
|
||||
|---------------------------------------------------------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [visio.numerique.gouv.fr](https://visio.numerique.gouv.fr/) | DINUM | French public agents working for the central administration and the extended public sphere. ProConnect is required to login in or sign up |
|
||||
| [visio.suite.anct.gouv.fr](https://visio.suite.anct.gouv.fr/) | ANCT | French public agents working for the territorial administration and the extended public sphere. ProConnect is required to login in or sign up |
|
||||
| [visio.lasuite.coop](https://visio.lasuite.coop/) | lasuite.coop | Free and open demo to all. Content and accounts are reset after one month |
|
||||
| [mosacloud.cloud](https://mosa.cloud/) | mosa.cloud | Demo instance of mosa.cloud, a dutch company providing services around La Suite apps. |
|
||||
| [Clever Cloud](https://www.clever.cloud/product/visio/) | clever cloud | Openvisio is a sovereign video conferencing solution based on LaSuite Meet offered by [Clever Cloud](https://www.clever.cloud/). |
|
||||
| [Email.eu](https://email.eu/) | Email.eu | Sovereign business workspace. |
|
||||
|
||||
|
||||
## Contributing
|
||||
# Contributing
|
||||
|
||||
We <3 contributions of any kind, big and small:
|
||||
We <3 contributions of all kinds **big or small** and we’re genuinely glad you’re here. 🌱
|
||||
|
||||
- Vote on features or get early access to beta functionality in our [roadmap](https://github.com/orgs/suitenumerique/projects/11/views/4)
|
||||
- Open a PR (see our instructions on [developing La Suite Meet locally](https://github.com/suitenumerique/meet/blob/main/docs/developping_locally.md))
|
||||
- Submit a [feature request](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=enhancement&template=Feature_request.md) or [bug report](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=bug&template=Bug_report.md)
|
||||
### Start by saying hi
|
||||
|
||||
**The best first contribution is simply to come say hi.**
|
||||
|
||||
Before opening a PR, especially a larger one, or one written with the help of AI, we encourage you to reach out to a maintainer on our [Matrix channel](https://matrix.to/#/#meet-official:matrix.org) (@antoine.lebaud:matrix.org).
|
||||
|
||||
Getting in touch early helps us align on goals, avoid duplicated or wasted effort, and build a community that stays active, welcoming, and fun to be part of. There are no silly questions here: whether you’ve shipped hundreds of PRs or you’re just getting started, you’re welcome.
|
||||
|
||||
### AI contributions
|
||||
|
||||
AI-assisted contributions are welcome. But code is never the end goal. What matters most is building relationships, sharing knowledge, and growing a sustainable community over time.
|
||||
|
||||
If your contribution has been heavily generated with AI, please be transparent about it. This helps maintainers review it with the right context and respects the time they invest in the project.
|
||||
|
||||
Using AI does not transfer ownership of the contribution: you should still fully understand the code, the problem it solves, and the reasoning behind the approach you propose. In short, even if AI helped write it, the why should still be yours.
|
||||
|
||||
### Contributions beyond code
|
||||
|
||||
**Not technical? We need you too.**
|
||||
Open source is much more than code. Writing documentation, improving onboarding, translating content, answering questions, reporting bugs, or simply helping others feel welcome all make a huge difference.
|
||||
|
||||
### Ways to contribute
|
||||
|
||||
When you’re ready, here are a few ways to get involved:
|
||||
|
||||
* 👋 **Say hello** and share your ideas with the community and maintainers on our [Matrix channel](https://matrix.to/#/#meet-official:matrix.org)
|
||||
* 🛠️ **Open a PR** by following our guide to [develop La Suite Meet locally](https://github.com/suitenumerique/meet/blob/main/docs/developping_locally.md)
|
||||
* 💡 **Suggest an idea** by opening a [feature request](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=enhancement&template=Feature_request.md)
|
||||
* 🐛 **Report a bug** by opening a [bug report](https://github.com/suitenumerique/meet/issues/new?assignees=&labels=bug&template=Bug_report.md)
|
||||
|
||||
Thank you for helping build something open, useful, and human. 💙
|
||||
|
||||
### Community call
|
||||
|
||||
We host a community call on the first Friday of every month to share updates, discuss ideas, and connect with contributors.
|
||||
|
||||
Whether you’re actively contributing or just curious about the project, you’re welcome to join. More details are shared on the [Matrix channel](https://matrix.to/#/#meet-official:matrix.org).
|
||||
|
||||
## Philosophy
|
||||
|
||||
|
||||
+11
-18
@@ -93,7 +93,7 @@ services:
|
||||
networks:
|
||||
- resource-server
|
||||
- default
|
||||
|
||||
|
||||
celery-dev:
|
||||
user: ${DOCKER_USER:-1000}
|
||||
image: meet:backend-development
|
||||
@@ -237,29 +237,22 @@ services:
|
||||
- livekit-egress
|
||||
|
||||
livekit-egress:
|
||||
image: livekit/egress:v1.11.0
|
||||
environment:
|
||||
EGRESS_CONFIG_FILE: ./livekit-egress.yaml
|
||||
volumes:
|
||||
- ./docker/livekit/config/livekit-egress.yaml:/livekit-egress.yaml
|
||||
- ./docker/livekit/out:/out
|
||||
depends_on:
|
||||
- redis
|
||||
image: livekit/egress:v1.11.0
|
||||
environment:
|
||||
EGRESS_CONFIG_FILE: ./livekit-egress.yaml
|
||||
volumes:
|
||||
- ./docker/livekit/config/livekit-egress.yaml:/livekit-egress.yaml
|
||||
- ./docker/livekit/out:/out
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
metadata-collector-dev:
|
||||
build:
|
||||
context: ./src/agents
|
||||
target: development
|
||||
command: ["python", "metadata_collector.py", "dev"]
|
||||
environment:
|
||||
- LIVEKIT_URL=ws://livekit:7880
|
||||
- LIVEKIT_API_KEY=devkey
|
||||
- LIVEKIT_API_SECRET=secret
|
||||
- AWS_S3_ENDPOINT_URL=minio:9000
|
||||
- AWS_S3_ACCESS_KEY_ID=meet
|
||||
- AWS_S3_SECRET_ACCESS_KEY=password
|
||||
- AWS_STORAGE_BUCKET_NAME=meet-media-storage
|
||||
- AWS_S3_SECURE_ACCESS=False
|
||||
env_file:
|
||||
- env.d/development/metadata_collector
|
||||
volumes:
|
||||
- ./src/agents:/app
|
||||
- /app/.venv
|
||||
|
||||
@@ -96,7 +96,7 @@ sequenceDiagram
|
||||
| **RECORDING_WORKER_CLASSES** | Dict | `{ "screen_recording": "core.recording.worker.services.VideoCompositeEgressService", "transcript": "core.recording.worker.services.AudioCompositeEgressService" }` | Maps recording types to their worker service classes. |
|
||||
| **RECORDING_EVENT_PARSER_CLASS** | String | `"core.recording.event.parsers.MinioParser"` | Class responsible for parsing storage events and updating the backend. |
|
||||
| **RECORDING_ENABLE_STORAGE_EVENT_AUTH** | Boolean | `True` | Enable authentication for storage event webhook requests. |
|
||||
| **RECORDING_STORAGE_EVENT_ENABLE** | Boolean | `False` | Enable handling of storage events (must configure webhook in storage). |
|
||||
| **RECORDING_STORAGE_EVENT_ENABLE** | Boolean | `False` | Enable handling of storage events (must configure webhook in storage). If `False`, fallback to LiveKit egress complete webhook. |
|
||||
| **RECORDING_STORAGE_EVENT_TOKEN** | Secret/File | `None` | Token used to authenticate storage webhook requests, if `RECORDING_ENABLE_STORAGE_EVENT_AUTH` is enabled. |
|
||||
| **RECORDING_EXPIRATION_DAYS** | Integer | `None` | Number of days before recordings expire. Should match bucket lifecycle policy. Set to `None` for no expiration. |
|
||||
| **RECORDING_MAX_DURATION** | Integer | `None` | Maximum duration of a recording in milliseconds. Must be synced with the LiveKit Egress configuration. Set to None for unlimited duration. When the maximum duration is reached, the recording is automatically stopped and saved, and the user is prompted in the frontend with an alert message. |
|
||||
|
||||
@@ -244,6 +244,69 @@ meet-admin <none> meet.127.0.0.1.nip.io localhost 80, 44
|
||||
|
||||
You can use LaSuite Meet on https://meet.127.0.0.1.nip.io from the local device. The provisioning user in keycloak is meet/meet.
|
||||
|
||||
## Rebranding the favicon
|
||||
|
||||
The favicon is bundled into the frontend image and served as a set of static
|
||||
files from `/usr/share/nginx/html` (`favicon.ico`, `favicon-16x16.png`,
|
||||
`favicon-32x32.png`, `apple-touch-icon.png`, `android-chrome-192x192.png`,
|
||||
`android-chrome-512x512.png`, `icon.png`). To rebrand without forking and
|
||||
rebuilding the image, overlay your own icons onto those paths with a volume —
|
||||
this serves the right icon from the first byte (no rebuild, no flash) and
|
||||
covers every variant, including the iOS home-screen and Android/PWA icons.
|
||||
|
||||
Put your icons in a `ConfigMap` (`binaryData` keeps the PNGs intact)…
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: meet-favicon
|
||||
binaryData:
|
||||
# base64 of each replacement icon
|
||||
favicon.ico: <base64…>
|
||||
favicon-16x16.png: <base64…>
|
||||
favicon-32x32.png: <base64…>
|
||||
apple-touch-icon.png: <base64…>
|
||||
android-chrome-192x192.png: <base64…>
|
||||
android-chrome-512x512.png: <base64…>
|
||||
```
|
||||
|
||||
```bash
|
||||
# e.g. build the ConfigMap straight from a directory of icons
|
||||
$ kubectl create configmap meet-favicon --from-file=./my-icons/
|
||||
```
|
||||
|
||||
…then mount each file over the bundled one via the chart's
|
||||
`frontend.extraVolumes` / `frontend.extraVolumeMounts` (the `subPath` mounts
|
||||
the single file without hiding the rest of `html/`):
|
||||
|
||||
```yaml
|
||||
frontend:
|
||||
extraVolumes:
|
||||
- name: favicon
|
||||
configMap:
|
||||
name: meet-favicon
|
||||
extraVolumeMounts:
|
||||
- name: favicon
|
||||
mountPath: /usr/share/nginx/html/favicon.ico
|
||||
subPath: favicon.ico
|
||||
- name: favicon
|
||||
mountPath: /usr/share/nginx/html/favicon-16x16.png
|
||||
subPath: favicon-16x16.png
|
||||
- name: favicon
|
||||
mountPath: /usr/share/nginx/html/favicon-32x32.png
|
||||
subPath: favicon-32x32.png
|
||||
- name: favicon
|
||||
mountPath: /usr/share/nginx/html/apple-touch-icon.png
|
||||
subPath: apple-touch-icon.png
|
||||
- name: favicon
|
||||
mountPath: /usr/share/nginx/html/android-chrome-192x192.png
|
||||
subPath: android-chrome-192x192.png
|
||||
- name: favicon
|
||||
mountPath: /usr/share/nginx/html/android-chrome-512x512.png
|
||||
subPath: android-chrome-512x512.png
|
||||
```
|
||||
|
||||
## All options
|
||||
|
||||
These are the environmental options available on meet backend.
|
||||
@@ -344,7 +407,7 @@ These are the environmental options available on meet backend.
|
||||
| RECORDING_WORKER_CLASSES | Worker classes for recording | {"screen_recording": "core.recording.worker.services.VideoCompositeEgressService","transcript": "core.recording.worker.services.AudioCompositeEgressService"} |
|
||||
| RECORDING_EVENT_PARSER_CLASS | Storage event engine for recording | core.recording.event.parsers.MinioParser |
|
||||
| RECORDING_ENABLE_STORAGE_EVENT_AUTH | Enable storage event authorization | true |
|
||||
| RECORDING_STORAGE_EVENT_ENABLE | Enable recording storage events | false |
|
||||
| RECORDING_STORAGE_EVENT_ENABLE | Enable recording storage events. If false, fallback to egress webhook. | false |
|
||||
| RECORDING_STORAGE_EVENT_TOKEN | Recording storage event token | |
|
||||
| RECORDING_EXPIRATION_DAYS | Recording expiration in days | |
|
||||
| RECORDING_MAX_DURATION | Maximum recording duration in milliseconds. Must match LiveKit Egress configuration exactly. | |
|
||||
|
||||
@@ -57,6 +57,7 @@ OIDC_RS_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
|
||||
LIVEKIT_API_SECRET=secret
|
||||
LIVEKIT_API_KEY=devkey
|
||||
LIVEKIT_API_URL=http://127.0.0.1.nip.io:7880
|
||||
LIVEKIT_INTERNAL_URL=http://livekit:7880
|
||||
LIVEKIT_VERIFY_SSL=False
|
||||
ALLOW_UNREGISTERED_ROOMS=False
|
||||
|
||||
@@ -86,6 +87,9 @@ ROOM_TELEPHONY_ENABLED=True
|
||||
# Metadata
|
||||
METADATA_COLLECTOR_ENABLED=True
|
||||
|
||||
# Subtitle
|
||||
ROOM_SUBTITLE_ENABLED=False
|
||||
|
||||
FRONTEND_USE_FRENCH_GOV_FOOTER=False
|
||||
FRONTEND_USE_PROCONNECT_BUTTON=False
|
||||
|
||||
@@ -94,3 +98,4 @@ EXTERNAL_API_ENABLED=True
|
||||
APPLICATION_JWT_AUDIENCE=http://localhost:8071/external-api/v1.0/
|
||||
APPLICATION_JWT_SECRET_KEY=devKey
|
||||
APPLICATION_BASE_URL=http://localhost:3000
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
LIVEKIT_URL=ws://livekit:7880
|
||||
LIVEKIT_API_KEY=devkey
|
||||
LIVEKIT_API_SECRET=secret
|
||||
|
||||
AWS_S3_ENDPOINT_URL=minio:9000
|
||||
AWS_S3_ACCESS_KEY_ID=meet
|
||||
AWS_S3_SECRET_ACCESS_KEY=password
|
||||
AWS_STORAGE_BUCKET_NAME=meet-media-storage
|
||||
AWS_S3_SECURE_ACCESS=False
|
||||
@@ -2,8 +2,10 @@ LIVEKIT_URL=ws://livekit:7880
|
||||
LIVEKIT_API_KEY=devkey
|
||||
LIVEKIT_API_SECRET=secret
|
||||
|
||||
STT_PROVIDER=kyutai
|
||||
STT_PROVIDER=kyutai # kyutai, deepgram
|
||||
ENABLE_SILERO_VAD=False
|
||||
|
||||
DEEPGRAM_API_KEY=
|
||||
|
||||
KYUTAI_STT_BASE_URL=
|
||||
KYUTAI_API_KEY=
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
APP_NAME="meet-app-summary-dev"
|
||||
APP_API_TOKEN="password"
|
||||
|
||||
AWS_STORAGE_BUCKET_NAME="http://meet-media-storage"
|
||||
AWS_STORAGE_BUCKET_NAME="meet-media-storage"
|
||||
AWS_S3_ENDPOINT_URL="minio:9000"
|
||||
AWS_S3_SECURE_ACCESS=false
|
||||
|
||||
@@ -20,6 +20,11 @@ LLM_MODEL="albert-large"
|
||||
WEBHOOK_API_TOKEN="secret"
|
||||
WEBHOOK_URL="https://configure-your-url.com"
|
||||
|
||||
IS_RESOLVE_SPEAKER_IDENTITIES_ENABLED=true
|
||||
RESOLVE_SPEAKER_IDENTITIES_DEFAULT_OVERLAP=0.5
|
||||
RESOLVE_SPEAKER_ENABLE_SPLIT_ON_WORDS=true
|
||||
RESOLVE_SPEAKER_MAX_WORD_DURATION=1
|
||||
|
||||
POSTHOG_API_KEY="your-posthog-key"
|
||||
POSTHOG_ENABLED="False"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM python:3.13.13-slim AS base
|
||||
FROM python:3.14.6-slim AS base
|
||||
|
||||
# Install system dependencies required by LiveKit
|
||||
RUN apt-get update && apt-get install -y \
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
|
||||
[project]
|
||||
name = "agents"
|
||||
version = "1.21.0"
|
||||
version = "1.22.0"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"livekit-agents==1.5.13",
|
||||
"livekit-plugins-deepgram==1.5.13",
|
||||
"livekit-plugins-silero==1.5.13",
|
||||
"livekit-agents==1.6.4",
|
||||
"livekit-plugins-deepgram==1.6.4",
|
||||
"livekit-plugins-silero==1.6.4",
|
||||
"livekit-plugins-kyutai-lasuite==0.0.6",
|
||||
"python-dotenv==1.2.2",
|
||||
"protobuf==6.33.6",
|
||||
"protobuf>=6.33.5",
|
||||
"minio==7.2.20"
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"ruff==0.15.14",
|
||||
"ruff==0.15.19",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
|
||||
Generated
+791
-718
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
"""
|
||||
Pluggable analytics.
|
||||
|
||||
Usage anywhere in the codebase:
|
||||
|
||||
from core import analytics
|
||||
|
||||
analytics.capture(request.user, "room_created", {"room_id": str(room.pk)})
|
||||
|
||||
The concrete backend is resolved lazily from Django settings, so swapping
|
||||
PostHog for anything else is a configuration change, not a code change.
|
||||
"""
|
||||
|
||||
from functools import lru_cache
|
||||
from typing import Any
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
from .base import AnalyticsBackend, NoOpAnalytics
|
||||
from .events import AnalyticsEvent
|
||||
|
||||
__all__ = [
|
||||
"get_analytics",
|
||||
"identify",
|
||||
"capture",
|
||||
"AnalyticsBackend",
|
||||
"AnalyticsEvent",
|
||||
]
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_analytics() -> AnalyticsBackend:
|
||||
"""Instantiate the configured backend once per process."""
|
||||
dotted_path = getattr(settings, "ANALYTICS_BACKEND", None)
|
||||
options = getattr(settings, "ANALYTICS_BACKEND_SETTINGS", {}) or {}
|
||||
|
||||
if not dotted_path:
|
||||
return NoOpAnalytics()
|
||||
|
||||
backend_class = import_string(dotted_path)
|
||||
return backend_class(**options)
|
||||
|
||||
|
||||
# Convenience module-level shortcuts
|
||||
|
||||
analytics_instance = get_analytics()
|
||||
|
||||
|
||||
def identify(user, properties: dict[str, Any] | None = None) -> None:
|
||||
"""Associate traits with an identified user."""
|
||||
analytics_instance.identify(user, properties)
|
||||
|
||||
|
||||
def capture(
|
||||
user, event: AnalyticsEvent, properties: dict[str, Any] | None = None
|
||||
) -> None:
|
||||
"""Record an event performed by an identified user."""
|
||||
analytics_instance.capture(user, event, properties)
|
||||
@@ -0,0 +1,50 @@
|
||||
"""Analytics backend protocol and default no-op implementation."""
|
||||
|
||||
from typing import Any, Protocol
|
||||
|
||||
from ..models import User
|
||||
from .events import AnalyticsEvent
|
||||
|
||||
|
||||
class AnalyticsBackend(Protocol):
|
||||
"""
|
||||
Interface every analytics backend must implement.
|
||||
|
||||
Backends are instantiated once (singleton) with the kwargs declared in
|
||||
settings.ANALYTICS_BACKEND_SETTINGS, e.g.:
|
||||
|
||||
ANALYTICS_BACKEND = "core.analytics.posthog.PostHogAnalytics"
|
||||
ANALYTICS_BACKEND_SETTINGS = {"api_key": "...", "host": "..."}
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
|
||||
def identify(self, user: User, properties: dict[str, Any] | None = None) -> None:
|
||||
"""Associate traits (email, name, ...) with an identified user."""
|
||||
|
||||
def capture(
|
||||
self,
|
||||
user: User,
|
||||
event: AnalyticsEvent,
|
||||
properties: dict[str, Any] | None = None,
|
||||
) -> None:
|
||||
"""Record an event performed by an identified user."""
|
||||
|
||||
def shutdown(self) -> None:
|
||||
"""Flush pending events. Called on process exit."""
|
||||
|
||||
|
||||
class NoOpAnalytics:
|
||||
"""Default backend: silently discards everything."""
|
||||
|
||||
def __init__(self, **kwargs: Any) -> None:
|
||||
"""No-op: accepts and ignores any backend settings kwargs."""
|
||||
|
||||
def identify(self, user: User, properties=None) -> None:
|
||||
"""No-op: discards identify calls."""
|
||||
|
||||
def capture(self, user, event, properties=None) -> None:
|
||||
"""No-op: discards captured events."""
|
||||
|
||||
def shutdown(self) -> None:
|
||||
"""No-op: nothing to flush."""
|
||||
@@ -0,0 +1,10 @@
|
||||
"""Catalog of all analytics events emitted by the backend."""
|
||||
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
class AnalyticsEvent(StrEnum):
|
||||
"""All trackable events. Values are the wire names sent to the provider."""
|
||||
|
||||
# Rooms
|
||||
ROOM_CREATED = "room_created"
|
||||
@@ -0,0 +1,74 @@
|
||||
"""PostHog implementation of the analytics backend protocol."""
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from posthog import Posthog
|
||||
|
||||
from ..models import User
|
||||
from .events import AnalyticsEvent
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PostHogAnalytics:
|
||||
"""Send events to PostHog, keyed on the user's primary key (UUID)."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
api_key: str,
|
||||
host: str = "https://eu.i.posthog.com",
|
||||
**kwargs: Any,
|
||||
) -> None:
|
||||
|
||||
# The SDK batches and sends in a background thread by default,
|
||||
# so calls below never block the request/response cycle.
|
||||
self._client = Posthog(
|
||||
project_api_key=api_key,
|
||||
host=host,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _distinct_id(user: User) -> str | None:
|
||||
"""Return the PostHog distinct_id for a user, or None if anonymous."""
|
||||
if user is None or not getattr(user, "is_authenticated", False):
|
||||
return None
|
||||
return str(user.pk)
|
||||
|
||||
def identify(self, user: User, properties: dict[str, Any] | None = None) -> None:
|
||||
"""Associate traits (email, name, ...) with an identified user."""
|
||||
distinct_id = self._distinct_id(user)
|
||||
if distinct_id is None:
|
||||
return
|
||||
try:
|
||||
self._client.set(
|
||||
distinct_id=distinct_id,
|
||||
properties=properties or {},
|
||||
)
|
||||
except Exception: # pylint: disable=broad-exception-caught
|
||||
logger.exception("PostHog identify failed")
|
||||
|
||||
def capture(
|
||||
self,
|
||||
user: User,
|
||||
event: AnalyticsEvent,
|
||||
properties: dict[str, Any] | None = None,
|
||||
) -> None:
|
||||
"""Record an event performed by an identified user."""
|
||||
distinct_id = self._distinct_id(user)
|
||||
if distinct_id is None:
|
||||
return
|
||||
try:
|
||||
self._client.capture(
|
||||
distinct_id=distinct_id,
|
||||
event=str(event),
|
||||
properties=properties or {},
|
||||
)
|
||||
except Exception: # pylint: disable=broad-exception-caught
|
||||
logger.exception("PostHog capture failed for event %s", event)
|
||||
|
||||
def shutdown(self) -> None:
|
||||
"""Flush pending events. Called on process exit."""
|
||||
self._client.shutdown()
|
||||
@@ -35,7 +35,7 @@ from rest_framework import (
|
||||
)
|
||||
from rest_framework.settings import api_settings
|
||||
|
||||
from core import enums, models, utils
|
||||
from core import analytics, enums, models, utils
|
||||
from core.api.filters import ListFileFilter
|
||||
from core.enums import MEDIA_STORAGE_URL_PATTERN
|
||||
from core.recording.enums import FileExtension
|
||||
@@ -46,12 +46,15 @@ from core.recording.event.exceptions import (
|
||||
InvalidFileTypeError,
|
||||
ParsingEventDataError,
|
||||
)
|
||||
from core.recording.event.notification import notification_service
|
||||
from core.recording.event.parsers import get_parser
|
||||
from core.recording.services.metadata_collector import (
|
||||
MetadataCollectorException,
|
||||
MetadataCollectorService,
|
||||
)
|
||||
from core.recording.services.recording_events import (
|
||||
RecordingEventsService,
|
||||
RecordingNotSavableError,
|
||||
)
|
||||
from core.recording.worker.exceptions import (
|
||||
RecordingStartError,
|
||||
RecordingStopError,
|
||||
@@ -305,6 +308,16 @@ class RoomViewSet(
|
||||
if callback_id := self.request.data.get("callback_id"):
|
||||
RoomCreation().persist_callback_state(callback_id, room)
|
||||
|
||||
analytics.capture(
|
||||
self.request.user,
|
||||
analytics.AnalyticsEvent.ROOM_CREATED,
|
||||
{
|
||||
"room_id": str(room.pk),
|
||||
"access_level": room.access_level,
|
||||
"from_callback": bool(self.request.data.get("callback_id")),
|
||||
},
|
||||
)
|
||||
|
||||
def perform_update(self, serializer):
|
||||
"""Persist the room update, then sync metadata to LiveKit."""
|
||||
|
||||
@@ -972,24 +985,15 @@ class RecordingViewSet(
|
||||
except models.Recording.DoesNotExist as e:
|
||||
raise drf_exceptions.NotFound("No recording found for this event.") from e
|
||||
|
||||
if not recording.is_savable():
|
||||
# Save recording
|
||||
recording_events_service = RecordingEventsService()
|
||||
try:
|
||||
recording_events_service.handle_complete(recording)
|
||||
except RecordingNotSavableError:
|
||||
raise drf_exceptions.PermissionDenied(
|
||||
f"Recording with ID {recording_id} cannot be saved because it is either,"
|
||||
" in an error state or has already been saved."
|
||||
)
|
||||
|
||||
# Attempt to notify external services about the recording
|
||||
# This is a non-blocking operation - failures are logged but don't interrupt the flow
|
||||
notification_succeeded = notification_service.notify_external_services(
|
||||
recording
|
||||
)
|
||||
|
||||
recording.status = (
|
||||
models.RecordingStatusChoices.NOTIFICATION_SUCCEEDED
|
||||
if notification_succeeded
|
||||
else models.RecordingStatusChoices.SAVED
|
||||
)
|
||||
recording.save()
|
||||
) from None
|
||||
|
||||
return drf_response.Response(
|
||||
{"message": "Event processed."},
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
from lasuite.oidc_login.backends import (
|
||||
OIDCAuthenticationBackend as LaSuiteOIDCAuthenticationBackend,
|
||||
)
|
||||
from rest_framework.authentication import SessionAuthentication
|
||||
|
||||
from core.models import User
|
||||
from core.services.marketing import (
|
||||
@@ -96,3 +97,17 @@ class OIDCAuthenticationBackend(LaSuiteOIDCAuthenticationBackend):
|
||||
"Multiple user accounts share a common email."
|
||||
) from e
|
||||
return None
|
||||
|
||||
|
||||
class SessionAuthenticationWith401(SessionAuthentication):
|
||||
"""
|
||||
Identical to DRF's SessionAuthentication, but returns a WWW-Authenticate
|
||||
header so unauthenticated requests get a 401 instead of a 403.
|
||||
|
||||
The scheme is deliberately NOT 'Basic' — that would trigger the browser's
|
||||
native login popup. 'Session' is ignored by the browser's auth UI but is
|
||||
still truthy, so DRF keeps the status at 401.
|
||||
"""
|
||||
|
||||
def authenticate_header(self, request):
|
||||
return "Session"
|
||||
|
||||
@@ -19,7 +19,7 @@ from rest_framework import (
|
||||
status as drf_status,
|
||||
)
|
||||
|
||||
from core import api, models
|
||||
from core import analytics, api, models
|
||||
from core.api.feature_flag import FeatureFlag
|
||||
from core.services.jwt_token import JwtTokenService
|
||||
|
||||
@@ -194,10 +194,26 @@ class RoomViewSet(
|
||||
role=models.RoleChoices.OWNER,
|
||||
)
|
||||
|
||||
auth_method = type(self.request.successful_authenticator).__name__
|
||||
client_id = (self.request.auth or {}).get("client_id", "unknown")
|
||||
|
||||
# Log for auditing
|
||||
logger.info(
|
||||
"Room created via application: room_id=%s, user_id=%s, client_id=%s",
|
||||
"Room created via application: room_id=%s, user_id=%s, client_id=%s, auth_method=%s",
|
||||
room.id,
|
||||
self.request.user.id,
|
||||
getattr(self.request.auth, "client_id", "unknown"),
|
||||
client_id,
|
||||
auth_method,
|
||||
)
|
||||
|
||||
analytics.capture(
|
||||
self.request.user,
|
||||
analytics.AnalyticsEvent.ROOM_CREATED,
|
||||
{
|
||||
"room_id": str(room.pk),
|
||||
"access_level": room.access_level,
|
||||
"client_id": client_id,
|
||||
"external_api": True,
|
||||
"auth_method": auth_method,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -6,6 +6,7 @@ from django.contrib.auth import get_user_model
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.db import transaction
|
||||
from django.db.models import Count
|
||||
from django.db.models.functions import Lower
|
||||
|
||||
from core.models import File, RecordingAccess, ResourceAccess, RoleChoices
|
||||
|
||||
@@ -20,11 +21,14 @@ ROLE_PRIORITY = {
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""
|
||||
Merge duplicate users sharing the same email into the most recently created one.
|
||||
Merge duplicate users sharing the same email (case-insensitive) into the
|
||||
most recently created one.
|
||||
|
||||
The KEPT user is the most recently created. All room memberships, recording
|
||||
accesses and files are transferred to it. When a conflict exists, the
|
||||
higher-privilege role wins. Stale users are then deleted.
|
||||
Emails are compared case-insensitively, so 'John@Example.com' and
|
||||
'john@example.com' are treated as duplicates. The KEPT user is the most
|
||||
recently created. All room memberships, recording accesses and files are
|
||||
transferred to it. When a conflict exists, the higher-privilege role wins.
|
||||
Stale users are then deleted.
|
||||
Each email group is processed inside a single database transaction.
|
||||
"""
|
||||
|
||||
@@ -56,13 +60,16 @@ class Command(BaseCommand):
|
||||
users_qs = users_qs.filter(email__icontains=email_filter)
|
||||
self.stdout.write(f"[INFO] Filtering emails containing '{email_filter}'.\n")
|
||||
|
||||
# Group emails case-insensitively so 'John@X.com' and 'john@x.com'
|
||||
# are detected as duplicates of each other.
|
||||
duplicate_emails = (
|
||||
users_qs.exclude(email__isnull=True)
|
||||
.exclude(email="")
|
||||
.values("email")
|
||||
.annotate(email_lower=Lower("email"))
|
||||
.values("email_lower")
|
||||
.annotate(cnt=Count("id"))
|
||||
.filter(cnt__gt=1)
|
||||
.values_list("email", flat=True)
|
||||
.values_list("email_lower", flat=True)
|
||||
)
|
||||
|
||||
if not duplicate_emails:
|
||||
@@ -78,9 +85,12 @@ class Command(BaseCommand):
|
||||
failed_emails = []
|
||||
|
||||
for email in duplicate_emails:
|
||||
# Case-insensitive lookup to fetch every casing variant of the email.
|
||||
# Secondary sort by id ensures a stable, deterministic order when
|
||||
# created_at timestamps are equal (common in tests and bulk imports).
|
||||
users = list(User.objects.filter(email=email).order_by("created_at", "id"))
|
||||
users = list(
|
||||
User.objects.filter(email__iexact=email).order_by("created_at", "id")
|
||||
)
|
||||
kept_user = users[-1]
|
||||
stale_users = users[:-1]
|
||||
|
||||
@@ -120,6 +130,10 @@ class Command(BaseCommand):
|
||||
failed_emails.append(email)
|
||||
self.stderr.write(f"[ERROR] Failed to merge '{email}': {exc}")
|
||||
|
||||
if not kept_user.email.islower():
|
||||
kept_user.email = kept_user.email.lower()
|
||||
kept_user.save(update_fields=["email"])
|
||||
|
||||
if failed_emails:
|
||||
raise CommandError(
|
||||
f"Failed to merge {len(failed_emails)} email group(s): {', '.join(failed_emails)}"
|
||||
|
||||
@@ -6,6 +6,7 @@ import re
|
||||
from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
from typing import Any, Dict, Optional, Protocol
|
||||
from urllib.parse import quote
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.module_loading import import_string
|
||||
@@ -58,7 +59,7 @@ class EventParser(Protocol):
|
||||
def parse(self, data: Dict) -> StorageEvent:
|
||||
"""Extract storage event data from raw dictionary input."""
|
||||
|
||||
def validate(self, data: StorageEvent) -> None:
|
||||
def validate(self, data: StorageEvent) -> str:
|
||||
"""Verify storage event data meets all requirements."""
|
||||
|
||||
def get_recording_id(self, data: Dict) -> str:
|
||||
@@ -164,6 +165,9 @@ class S3Parser(BaseS3Parser):
|
||||
if not filepath:
|
||||
raise ParsingEventDataError("Missing object key name")
|
||||
filetype, _ = mimetypes.guess_type(filepath)
|
||||
# Normalize raw S3-compatible object keys without re-encoding
|
||||
# already encoded AWS S3 notification keys.
|
||||
filepath = quote(filepath, safe="%+")
|
||||
return StorageEvent(
|
||||
filepath=filepath,
|
||||
filetype=filetype,
|
||||
|
||||
@@ -8,6 +8,7 @@ from livekit import api
|
||||
|
||||
from core import models, utils
|
||||
from core.models import Recording
|
||||
from core.recording.event.notification import notification_service
|
||||
|
||||
logger = getLogger(__name__)
|
||||
|
||||
@@ -16,6 +17,10 @@ class RecordingEventsError(Exception):
|
||||
"""Recording event handling fails."""
|
||||
|
||||
|
||||
class RecordingNotSavableError(Exception):
|
||||
"""Recording cannot be saved because it is either in an error state or has already been saved"""
|
||||
|
||||
|
||||
class RecordingEventsService:
|
||||
"""Handles recording-related LiveKit webhook events."""
|
||||
|
||||
@@ -73,3 +78,23 @@ class RecordingEventsService:
|
||||
f"Failed to notify participants in room '{recording.room.id}' about "
|
||||
f"recording limit reached (recording_id={recording.id})"
|
||||
) from e
|
||||
|
||||
@staticmethod
|
||||
def handle_complete(recording: Recording):
|
||||
"""Notify external services and save recording."""
|
||||
|
||||
if not recording.is_savable():
|
||||
raise RecordingNotSavableError
|
||||
|
||||
# Attempt to notify external services about the recording
|
||||
# This is a non-blocking operation - failures are logged but don't interrupt the flow
|
||||
notification_succeeded = notification_service.notify_external_services(
|
||||
recording
|
||||
)
|
||||
|
||||
recording.status = (
|
||||
models.RecordingStatusChoices.NOTIFICATION_SUCCEEDED
|
||||
if notification_succeeded
|
||||
else models.RecordingStatusChoices.SAVED
|
||||
)
|
||||
recording.save()
|
||||
|
||||
@@ -19,6 +19,7 @@ from core.recording.services.metadata_collector import (
|
||||
from core.recording.services.recording_events import (
|
||||
RecordingEventsError,
|
||||
RecordingEventsService,
|
||||
RecordingNotSavableError,
|
||||
)
|
||||
|
||||
from .lobby import LobbyService
|
||||
@@ -88,6 +89,13 @@ class LiveKitEventsService:
|
||||
def __init__(self):
|
||||
"""Initialize with required services."""
|
||||
|
||||
self._webhook_handlers = {
|
||||
"egress_updated": self._handle_egress_updated,
|
||||
"egress_ended": self._handle_egress_ended,
|
||||
"room_started": self._handle_room_started,
|
||||
"room_finished": self._handle_room_finished,
|
||||
}
|
||||
|
||||
token_verifier = api.TokenVerifier(
|
||||
settings.LIVEKIT_CONFIGURATION["api_key"],
|
||||
settings.LIVEKIT_CONFIGURATION["api_secret"],
|
||||
@@ -135,14 +143,11 @@ class LiveKitEventsService:
|
||||
f"Unknown webhook type: {data.event}"
|
||||
) from e
|
||||
|
||||
handler_name = f"_handle_{webhook_type.value}"
|
||||
handler = getattr(self, handler_name, None)
|
||||
# Handle according to received webhook type
|
||||
handler = self._webhook_handlers.get(webhook_type.value)
|
||||
|
||||
if not handler or not callable(handler):
|
||||
return
|
||||
|
||||
# pylint: disable=not-callable
|
||||
handler(data)
|
||||
if handler is not None:
|
||||
handler(data)
|
||||
|
||||
def _handle_egress_updated(self, data):
|
||||
"""Handle 'egress_updated' event."""
|
||||
@@ -195,6 +200,24 @@ class LiveKitEventsService:
|
||||
f"Failed to process limit reached event for recording {recording}"
|
||||
) from e
|
||||
|
||||
# Fallback for completion when no MinIO/S3 webhooks are configured
|
||||
if (
|
||||
not settings.RECORDING_STORAGE_EVENT_ENABLE
|
||||
) and data.egress_info.status in [
|
||||
api.EgressStatus.EGRESS_COMPLETE,
|
||||
api.EgressStatus.EGRESS_LIMIT_REACHED,
|
||||
]:
|
||||
try:
|
||||
self.recording_events.handle_complete(recording)
|
||||
except RecordingNotSavableError:
|
||||
logger.warning(
|
||||
"Recording %s is not savable on egress complete "
|
||||
"(already saved or in an error state); ignoring.",
|
||||
recording.id,
|
||||
)
|
||||
|
||||
# Silently ignoring EGRESS_ABORTED, EGRESS_FAILED
|
||||
|
||||
def _handle_room_started(self, data):
|
||||
"""Handle 'room_started' event."""
|
||||
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
"""
|
||||
Unit tests for PostHogAnalytics.
|
||||
"""
|
||||
|
||||
# pylint: disable=redefined-outer-name,unused-argument,protected-access
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
import pytest
|
||||
|
||||
from core.analytics.events import AnalyticsEvent
|
||||
from core.analytics.posthog import PostHogAnalytics
|
||||
from core.factories import UserFactory
|
||||
|
||||
pytestmark = pytest.mark.django_db
|
||||
|
||||
|
||||
# ==============================
|
||||
# __init__
|
||||
# ==============================
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_init_constructs_posthog_client_with_api_key_and_host(mock_posthog_cls):
|
||||
"""Should forward api_key and host to the Posthog SDK constructor."""
|
||||
PostHogAnalytics(api_key="my-key", host="https://custom.i.posthog.com")
|
||||
|
||||
mock_posthog_cls.assert_called_once_with(
|
||||
project_api_key="my-key",
|
||||
host="https://custom.i.posthog.com",
|
||||
)
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_init_defaults_to_eu_host(mock_posthog_cls):
|
||||
"""Should default host to the EU PostHog cloud when not specified."""
|
||||
PostHogAnalytics(api_key="my-key")
|
||||
|
||||
_, kwargs = mock_posthog_cls.call_args
|
||||
assert kwargs["host"] == "https://eu.i.posthog.com"
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_init_forwards_extra_kwargs_to_client(mock_posthog_cls):
|
||||
"""Should pass through arbitrary extra kwargs (e.g. debug, disabled) to the SDK."""
|
||||
PostHogAnalytics(api_key="my-key", debug=True, disabled=False)
|
||||
|
||||
_, kwargs = mock_posthog_cls.call_args
|
||||
assert kwargs["debug"] is True
|
||||
assert kwargs["disabled"] is False
|
||||
|
||||
|
||||
# ==============================
|
||||
# _distinct_id
|
||||
# ==============================
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_distinct_id_returns_none_for_none_user(mock_posthog_cls):
|
||||
"""Should return None when user is None."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
assert backend._distinct_id(None) is None
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_distinct_id_returns_none_for_anonymous_user(mock_posthog_cls):
|
||||
"""Should return None when user.is_authenticated is falsy."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
assert backend._distinct_id(AnonymousUser()) is None
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_distinct_id_returns_none_when_attribute_missing(mock_posthog_cls):
|
||||
"""Should return None when the user object has no is_authenticated attribute at all."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
assert backend._distinct_id(object()) is None
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_distinct_id_returns_stringified_pk_for_authenticated_user(mock_posthog_cls):
|
||||
"""Should return str(user.pk) for an authenticated user."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
assert backend._distinct_id(user) == str(user.pk)
|
||||
|
||||
|
||||
# ==============================
|
||||
# identify
|
||||
# ==============================
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_identify_noop_for_anonymous_user(mock_posthog_cls):
|
||||
"""Should not call the SDK when the user is anonymous."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
backend.identify(AnonymousUser(), {"email": "a@example.com"})
|
||||
|
||||
mock_posthog_cls.return_value.set.assert_not_called()
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_identify_noop_for_none_user(mock_posthog_cls):
|
||||
"""Should not call the SDK when user is None."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
backend.identify(None, {"email": "a@example.com"})
|
||||
|
||||
mock_posthog_cls.return_value.set.assert_not_called()
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_identify_sends_set_properties_for_authenticated_user(mock_posthog_cls):
|
||||
"""Should call capture with event=$identify and properties wrapped in $set."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
backend.identify(user, {"email": "a@example.com", "name": "A"})
|
||||
|
||||
mock_posthog_cls.return_value.set.assert_called_once_with(
|
||||
distinct_id=str(user.pk),
|
||||
properties={"email": "a@example.com", "name": "A"},
|
||||
)
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_identify_defaults_properties_to_empty_dict(mock_posthog_cls):
|
||||
"""Should send an empty $set payload when properties is None."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
backend.identify(user, None)
|
||||
|
||||
mock_posthog_cls.return_value.set.assert_called_once_with(
|
||||
distinct_id=str(user.pk),
|
||||
properties={},
|
||||
)
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_identify_swallows_sdk_exceptions(mock_posthog_cls):
|
||||
"""Should log and not raise when the SDK call fails."""
|
||||
mock_posthog_cls.return_value.set.side_effect = RuntimeError("network down")
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
# Must not propagate.
|
||||
backend.identify(user, {"email": "a@example.com"})
|
||||
|
||||
|
||||
# ==============================
|
||||
# capture
|
||||
# ==============================
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_noop_for_anonymous_user(mock_posthog_cls):
|
||||
"""Should not call the SDK when the user is anonymous."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
backend.capture(AnonymousUser(), AnalyticsEvent.ROOM_CREATED, {"room_id": "1"})
|
||||
|
||||
mock_posthog_cls.return_value.capture.assert_not_called()
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_noop_for_none_user(mock_posthog_cls):
|
||||
"""Should not call the SDK when user is None."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
backend.capture(None, AnalyticsEvent.ROOM_CREATED, {"room_id": "1"})
|
||||
|
||||
mock_posthog_cls.return_value.capture.assert_not_called()
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_sends_event_and_properties_for_authenticated_user(mock_posthog_cls):
|
||||
"""Should call capture with the distinct_id, event name, and properties."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
backend.capture(user, AnalyticsEvent.ROOM_CREATED, {"room_id": "room-1"})
|
||||
|
||||
mock_posthog_cls.return_value.capture.assert_called_once_with(
|
||||
distinct_id=str(user.pk),
|
||||
event="room_created",
|
||||
properties={"room_id": "room-1"},
|
||||
)
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_serializes_event_enum_to_plain_string(mock_posthog_cls):
|
||||
"""Should send the wire string, not the AnalyticsEvent enum member, to the SDK."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
backend.capture(user, AnalyticsEvent.ROOM_CREATED)
|
||||
|
||||
_, kwargs = mock_posthog_cls.return_value.capture.call_args
|
||||
assert kwargs["event"] == "room_created"
|
||||
assert isinstance(
|
||||
kwargs["event"], str
|
||||
) # not AnalyticsEvent, not StrEnum subclass leaking through
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_defaults_properties_to_empty_dict(mock_posthog_cls):
|
||||
"""Should send an empty properties dict when properties is None."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
backend.capture(user, AnalyticsEvent.ROOM_CREATED, None)
|
||||
|
||||
mock_posthog_cls.return_value.capture.assert_called_once_with(
|
||||
distinct_id=str(user.pk),
|
||||
event="room_created",
|
||||
properties={},
|
||||
)
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_swallows_sdk_exceptions(mock_posthog_cls):
|
||||
"""Should log and not raise when the SDK call fails."""
|
||||
mock_posthog_cls.return_value.capture.side_effect = RuntimeError("network down")
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
# Must not propagate.
|
||||
backend.capture(user, AnalyticsEvent.ROOM_CREATED, {"room_id": "1"})
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_capture_logs_the_failing_event_name_on_exception(mock_posthog_cls, caplog):
|
||||
"""Should log which event failed, to aid debugging without crashing the caller."""
|
||||
mock_posthog_cls.return_value.capture.side_effect = RuntimeError("network down")
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
user = UserFactory()
|
||||
|
||||
with caplog.at_level("ERROR"):
|
||||
backend.capture(user, AnalyticsEvent.ROOM_CREATED)
|
||||
|
||||
assert any("PostHog capture failed" in record.message for record in caplog.records)
|
||||
|
||||
|
||||
# ==============================
|
||||
# shutdown
|
||||
# ==============================
|
||||
|
||||
|
||||
@patch("core.analytics.posthog.Posthog")
|
||||
def test_shutdown_flushes_the_client(mock_posthog_cls):
|
||||
"""Should delegate to the SDK's shutdown to flush pending events."""
|
||||
backend = PostHogAnalytics(api_key="test-api-key")
|
||||
|
||||
backend.shutdown()
|
||||
|
||||
mock_posthog_cls.return_value.shutdown.assert_called_once()
|
||||
@@ -36,6 +36,26 @@ def test_merge_keeps_most_recently_created_user():
|
||||
assert User.objects.filter(id=user2.id).exists()
|
||||
|
||||
|
||||
def test_merge_user_case_insensitive():
|
||||
"""Emails differing only by case should be treated as duplicates and merged,
|
||||
keeping the most recently created user."""
|
||||
user1 = UserFactory(email="Dup@example.com")
|
||||
user2 = UserFactory(email="dup@example.com")
|
||||
call_command("merge_duplicate_users")
|
||||
|
||||
assert not User.objects.filter(id=user1.id).exists()
|
||||
assert User.objects.filter(id=user2.id).exists()
|
||||
|
||||
user3 = UserFactory(email="joe@example.com")
|
||||
user4 = UserFactory(email="Joe@example.com")
|
||||
call_command("merge_duplicate_users")
|
||||
assert not User.objects.filter(id=user3.id).exists()
|
||||
assert User.objects.filter(id=user4.id).exists()
|
||||
|
||||
user4.refresh_from_db()
|
||||
assert user4.email.islower()
|
||||
|
||||
|
||||
def test_merge_deletes_all_stale_users():
|
||||
"""Command should delete all stale users and keep only the most recently created one."""
|
||||
email = "many@example.com"
|
||||
@@ -457,4 +477,4 @@ def test_merge_email_filter_is_case_insensitive():
|
||||
UserFactory(email="user1@Example.com")
|
||||
UserFactory(email="user1@Example.com")
|
||||
call_command("merge_duplicate_users", email_filter="@example.com")
|
||||
assert User.objects.filter(email="user1@Example.com").count() == 1
|
||||
assert User.objects.filter(email="user1@example.com").count() == 1
|
||||
|
||||
@@ -360,6 +360,75 @@ def test_s3_parse_unrecognized_extension(s3_parser):
|
||||
s3_parser.parse(event_with_unknown_ext)
|
||||
|
||||
|
||||
def test_s3_parser_keeps_encoded_filepath_compatible(settings):
|
||||
"""Test S3 parser keeps already encoded object keys compatible."""
|
||||
settings.RECORDING_OUTPUT_FOLDER = "recordings"
|
||||
|
||||
recording_id = "80ae9fe5-639a-438b-b86e-9e3dd2d55f4d"
|
||||
parser = S3Parser(bucket_name="recordings-bucket")
|
||||
|
||||
data = {
|
||||
"Records": [
|
||||
{
|
||||
"s3": {
|
||||
"bucket": {"name": "recordings-bucket"},
|
||||
"object": {
|
||||
"key": f"recordings%2F{recording_id}.mp4",
|
||||
},
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
assert parser.get_recording_id(data) == recording_id
|
||||
|
||||
|
||||
def test_s3_parser_accepts_unencoded_filepath(settings):
|
||||
"""Test S3 parser accepts raw object keys with slash separators."""
|
||||
settings.RECORDING_OUTPUT_FOLDER = "recordings"
|
||||
|
||||
recording_id = "80ae9fe5-639a-438b-b86e-9e3dd2d55f4d"
|
||||
parser = S3Parser(bucket_name="recordings-bucket")
|
||||
|
||||
data = {
|
||||
"Records": [
|
||||
{
|
||||
"s3": {
|
||||
"bucket": {"name": "recordings-bucket"},
|
||||
"object": {
|
||||
"key": f"recordings/{recording_id}.mp4",
|
||||
},
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
assert parser.get_recording_id(data) == recording_id
|
||||
|
||||
|
||||
def test_s3_parser_preserves_plus_signs_in_encoded_filepath(settings):
|
||||
"""Test S3 parser preserves plus signs in already encoded object keys."""
|
||||
settings.RECORDING_OUTPUT_FOLDER = "recordings"
|
||||
|
||||
recording_id = "80ae9fe5-639a-438b-b86e-9e3dd2d55f4d"
|
||||
parser = S3Parser(bucket_name="recordings-bucket")
|
||||
|
||||
data = {
|
||||
"Records": [
|
||||
{
|
||||
"s3": {
|
||||
"bucket": {"name": "recordings-bucket"},
|
||||
"object": {
|
||||
"key": f"folder+name%2Frecordings%2F{recording_id}.mp4",
|
||||
},
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
assert parser.get_recording_id(data) == recording_id
|
||||
|
||||
|
||||
def test_s3_get_recording_id_success(s3_parser, valid_s3_event):
|
||||
"""Test successful extraction of recording ID from S3 event."""
|
||||
recording_id = s3_parser.get_recording_id(valid_s3_event)
|
||||
|
||||
@@ -224,3 +224,44 @@ def test_save_recording_success(recording_settings, mock_get_parser, client, sta
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == RecordingStatusChoices.SAVED
|
||||
|
||||
|
||||
@mock.patch(
|
||||
"core.recording.services.recording_events.notification_service."
|
||||
"notify_external_services"
|
||||
)
|
||||
@pytest.mark.parametrize("notification_succeeded", [True, False])
|
||||
def test_save_recording_notifies_external_services(
|
||||
mock_notify_external_services,
|
||||
recording_settings,
|
||||
mock_get_parser,
|
||||
client,
|
||||
notification_succeeded,
|
||||
):
|
||||
"""External services should be notified when a recording is saved."""
|
||||
|
||||
recording = RecordingFactory(status="active")
|
||||
|
||||
mock_parser = mock.Mock()
|
||||
mock_parser.get_recording_id.return_value = recording.id
|
||||
mock_get_parser.return_value = mock_parser
|
||||
|
||||
mock_notify_external_services.return_value = notification_succeeded
|
||||
|
||||
response = client.post(
|
||||
"/api/v1.0/recordings/storage-hook/",
|
||||
{"recording_data": "valid-data"},
|
||||
HTTP_AUTHORIZATION="Bearer testAuthToken",
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"message": "Event processed."}
|
||||
|
||||
mock_notify_external_services.assert_called_once_with(recording)
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == (
|
||||
RecordingStatusChoices.NOTIFICATION_SUCCEEDED
|
||||
if notification_succeeded
|
||||
else RecordingStatusChoices.SAVED
|
||||
)
|
||||
|
||||
@@ -91,7 +91,9 @@ def test_handle_egress_ended_success(
|
||||
)
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == "stopped"
|
||||
|
||||
# NB: notify_external_services will return False, so status is "saved"
|
||||
assert recording.status == "saved"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -155,7 +157,7 @@ def test_handle_egress_updated_non_handled(
|
||||
def test_handle_egress_ended_metadata_update_fails(
|
||||
mock_update_room_metadata, mock_notify, mode, notification_type, service
|
||||
):
|
||||
"""Should successfully stop recording when metadata's update fails."""
|
||||
"""Should successfully stop and save recording when metadata's update fails."""
|
||||
|
||||
recording = RecordingFactory(worker_id="worker-1", mode=mode, status="active")
|
||||
mock_data = mock.MagicMock()
|
||||
@@ -170,7 +172,9 @@ def test_handle_egress_ended_metadata_update_fails(
|
||||
room_name=str(recording.room.id), notification_data={"type": notification_type}
|
||||
)
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == "stopped"
|
||||
|
||||
# NB: notify_external_services will return False, so status is "saved"
|
||||
assert recording.status == "saved"
|
||||
|
||||
|
||||
@mock.patch("core.utils.notify_participants")
|
||||
@@ -326,6 +330,143 @@ def test_handle_egress_ended_does_not_call_metadata_collector_stop_when_conditio
|
||||
mock_collector.stop.assert_not_called()
|
||||
|
||||
|
||||
@mock.patch(
|
||||
"core.recording.services.recording_events.notification_service."
|
||||
"notify_external_services"
|
||||
)
|
||||
@mock.patch("core.utils.notify_participants")
|
||||
@mock.patch("core.utils.update_room_metadata")
|
||||
@pytest.mark.parametrize(
|
||||
"egress_status",
|
||||
[EgressStatus.EGRESS_COMPLETE, EgressStatus.EGRESS_LIMIT_REACHED],
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
"notify_return_value, recording_status",
|
||||
[(True, "notification_succeeded"), (False, "saved")],
|
||||
)
|
||||
def test_handle_egress_ended_finalizes_recording( # noqa: PLR0913
|
||||
mock_update_room_metadata,
|
||||
mock_notify,
|
||||
mock_notify_external_services,
|
||||
notify_return_value,
|
||||
recording_status,
|
||||
egress_status,
|
||||
service,
|
||||
settings,
|
||||
): # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
"""Should notify external services and save the recording on egress completion
|
||||
(EGRESS_COMPLETE or EGRESS_LIMIT_REACHED) when RECORDING_STORAGE_EVENT_ENABLE is False.
|
||||
"""
|
||||
settings.RECORDING_STORAGE_EVENT_ENABLE = False
|
||||
mock_notify_external_services.return_value = notify_return_value
|
||||
|
||||
recording = RecordingFactory(worker_id="worker-1", status="active")
|
||||
mock_data = mock.MagicMock()
|
||||
mock_data.egress_info.egress_id = recording.worker_id
|
||||
mock_data.egress_info.status = egress_status
|
||||
|
||||
service._handle_egress_ended(mock_data)
|
||||
|
||||
mock_notify_external_services.assert_called_once_with(recording)
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == recording_status
|
||||
|
||||
|
||||
@mock.patch(
|
||||
"core.recording.services.recording_events.notification_service."
|
||||
"notify_external_services"
|
||||
)
|
||||
@mock.patch("core.utils.notify_participants")
|
||||
@mock.patch("core.utils.update_room_metadata")
|
||||
@pytest.mark.parametrize(
|
||||
"egress_status, expected_status",
|
||||
[
|
||||
(EgressStatus.EGRESS_COMPLETE, "active"),
|
||||
(EgressStatus.EGRESS_LIMIT_REACHED, "stopped"),
|
||||
],
|
||||
)
|
||||
def test_handle_egress_ended_does_not_finalize_when_webhooks_enabled( # noqa: PLR0913
|
||||
mock_update_room_metadata,
|
||||
mock_notify,
|
||||
mock_notify_external_services,
|
||||
egress_status,
|
||||
expected_status,
|
||||
service,
|
||||
settings,
|
||||
): # pylint: disable=too-many-arguments,too-many-positional-arguments
|
||||
"""When storage event webhooks are enabled, egress_ended must not finalize the
|
||||
recording: external services are never notified. EGRESS_LIMIT_REACHED still stops
|
||||
the recording, EGRESS_COMPLETE leaves it active.
|
||||
"""
|
||||
settings.RECORDING_STORAGE_EVENT_ENABLE = True
|
||||
|
||||
recording = RecordingFactory(worker_id="worker-1", status="active")
|
||||
mock_data = mock.MagicMock()
|
||||
mock_data.egress_info.egress_id = recording.worker_id
|
||||
mock_data.egress_info.status = egress_status
|
||||
|
||||
service._handle_egress_ended(mock_data)
|
||||
|
||||
mock_notify_external_services.assert_not_called()
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == expected_status
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"egress_status",
|
||||
[
|
||||
EgressStatus.EGRESS_STARTING,
|
||||
EgressStatus.EGRESS_ACTIVE,
|
||||
EgressStatus.EGRESS_ENDING,
|
||||
EgressStatus.EGRESS_FAILED,
|
||||
EgressStatus.EGRESS_ABORTED,
|
||||
],
|
||||
)
|
||||
@mock.patch("core.utils.update_room_metadata")
|
||||
def test_handle_egress_ended_does_not_save_on_wrong_status(
|
||||
mock_update_room_metadata, egress_status, service, settings
|
||||
):
|
||||
"""Shouldn't save on invalid status."""
|
||||
settings.RECORDING_STORAGE_EVENT_ENABLE = False
|
||||
|
||||
recording = RecordingFactory(worker_id="worker-1", status="active")
|
||||
mock_data = mock.MagicMock()
|
||||
mock_data.egress_info.egress_id = recording.worker_id
|
||||
mock_data.egress_info.status = egress_status
|
||||
|
||||
service._handle_egress_ended(mock_data)
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == "active"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"status", ["failed_to_start", "aborted", "failed_to_stop", "saved", "initiated"]
|
||||
)
|
||||
@mock.patch("core.utils.update_room_metadata")
|
||||
def test_handle_egress_ended_ignores_non_savable_recording(
|
||||
mock_update_room_metadata, status, service, settings
|
||||
):
|
||||
"""Should handle non-savable recordings idempotently without raising.
|
||||
|
||||
'egress_ended' may be redelivered (e.g. for an already-saved recording);
|
||||
this must not raise, otherwise the webhook would 500 and LiveKit would retry.
|
||||
"""
|
||||
settings.RECORDING_STORAGE_EVENT_ENABLE = False
|
||||
|
||||
recording = RecordingFactory(worker_id="worker-1", status=status)
|
||||
mock_data = mock.MagicMock()
|
||||
mock_data.egress_info.egress_id = recording.worker_id
|
||||
mock_data.egress_info.status = EgressStatus.EGRESS_COMPLETE
|
||||
|
||||
service._handle_egress_ended(mock_data)
|
||||
|
||||
recording.refresh_from_db()
|
||||
assert recording.status == status
|
||||
|
||||
|
||||
@mock.patch.object(LobbyService, "clear_room_cache")
|
||||
@mock.patch.object(TelephonyService, "delete_dispatch_rule")
|
||||
def test_handle_room_finished_clears_cache_and_deletes_dispatch_rule(
|
||||
|
||||
@@ -323,8 +323,7 @@ class Base(Configuration):
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": (
|
||||
"mozilla_django_oidc.contrib.drf.OIDCAuthentication",
|
||||
"rest_framework.authentication.SessionAuthentication",
|
||||
"core.authentication.backends.SessionAuthenticationWith401",
|
||||
),
|
||||
"DEFAULT_PARSER_CLASSES": [
|
||||
"rest_framework.parsers.JSONParser",
|
||||
@@ -762,6 +761,14 @@ class Base(Configuration):
|
||||
None, environ_name="RECORDING_DOWNLOAD_BASE_URL", environ_prefix=None
|
||||
)
|
||||
|
||||
# Analytics
|
||||
ANALYTICS_BACKEND = values.Value(
|
||||
None, environ_name="ANALYTICS_BACKEND", environ_prefix=None
|
||||
)
|
||||
ANALYTICS_BACKEND_SETTINGS = values.DictValue(
|
||||
{}, environ_name="ANALYTICS_BACKEND_SETTINGS", environ_prefix=None
|
||||
)
|
||||
|
||||
# Marketing and communication settings
|
||||
SIGNUP_NEW_USER_TO_MARKETING_EMAIL = values.BooleanValue(
|
||||
False, # When enabled, new users are automatically added to mailing list.
|
||||
|
||||
+14
-13
@@ -7,7 +7,7 @@ build-backend = "uv_build"
|
||||
|
||||
[project]
|
||||
name = "meet"
|
||||
version = "1.21.0"
|
||||
version = "1.22.0"
|
||||
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
@@ -24,19 +24,19 @@ keywords = ["Django", "Contacts", "Templates", "RBAC"]
|
||||
license = "MIT"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"boto3==1.43.14",
|
||||
"boto3==1.43.36",
|
||||
"Brotli==1.2.0",
|
||||
"brevo-python==1.2.0",
|
||||
"celery[redis]==5.6.3",
|
||||
"dj-database-url==3.1.2",
|
||||
"django-configurations==2.5.1",
|
||||
"django-cors-headers==4.9.0",
|
||||
"django-countries==8.2.0",
|
||||
"django-countries==9.0.0",
|
||||
"django-filter==25.2",
|
||||
"django-lasuite[all]==0.0.26",
|
||||
"django-lasuite[all]==0.0.27",
|
||||
"django-parler==2.4",
|
||||
"redis==5.2.1",
|
||||
"django-redis==6.0.0",
|
||||
"django-redis==7.0.0",
|
||||
"django-storages[s3]==1.14.6",
|
||||
"django-timezone-field>=5.1",
|
||||
"django-pydantic-field==0.5.4",
|
||||
@@ -50,19 +50,20 @@ dependencies = [
|
||||
"jsonschema==4.26.0",
|
||||
"markdown==3.10.2",
|
||||
"nested-multipart-parser==1.6.0",
|
||||
"posthog==7.16.1",
|
||||
"psycopg[binary]==3.3.4",
|
||||
"pydantic==2.13.4",
|
||||
"PyJWT==2.13.0",
|
||||
"python-frontmatter==1.3.0",
|
||||
"python-magic==0.4.27",
|
||||
"requests==2.34.2",
|
||||
"sentry-sdk==2.60.0",
|
||||
"sentry-sdk==2.63.0",
|
||||
"whitenoise==6.12.0",
|
||||
"mozilla-django-oidc==5.0.2",
|
||||
"livekit-api==1.1.0",
|
||||
"aiohttp==3.14.0",
|
||||
"livekit-api==1.1.1",
|
||||
"aiohttp==3.14.1",
|
||||
"urllib3==2.7.0",
|
||||
"phonenumbers==9.0.31",
|
||||
"phonenumbers==9.0.33",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
@@ -74,20 +75,20 @@ dependencies = [
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"django-extensions==4.1",
|
||||
"drf-spectacular-sidecar==2026.5.1",
|
||||
"drf-spectacular-sidecar==2026.6.1",
|
||||
"freezegun==1.5.5",
|
||||
"ipdb==0.13.13",
|
||||
"ipython==9.13.0",
|
||||
"ipython==9.14.1",
|
||||
"pyfakefs==6.2.0",
|
||||
"pylint-django==2.7.0",
|
||||
"pylint<4.0.0",
|
||||
"pytest-cov==7.1.0",
|
||||
"pytest-django==4.12.0",
|
||||
"pytest==9.0.3",
|
||||
"pytest==9.1.1",
|
||||
"pytest-icdiff==0.9",
|
||||
"pytest-xdist==3.8.0",
|
||||
"responses==0.26.1",
|
||||
"ruff==0.15.14",
|
||||
"ruff==0.15.19",
|
||||
"types-requests==2.33.0.20260518",
|
||||
]
|
||||
|
||||
|
||||
Generated
+543
-517
File diff suppressed because it is too large
Load Diff
Generated
+70
-2031
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "meet",
|
||||
"private": true,
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "panda codegen && vite",
|
||||
@@ -22,8 +22,7 @@
|
||||
"@livekit/components-react": "2.9.21",
|
||||
"@livekit/components-styles": "1.2.0",
|
||||
"@livekit/track-processors": "0.7.2",
|
||||
"@pandacss/preset-panda": "1.11.1",
|
||||
"@react-aria/toast": "3.0.10",
|
||||
"@pandacss/preset-panda": "1.11.3",
|
||||
"@react-types/overlays": "3.10.0",
|
||||
"@remixicon/react": "4.9.0",
|
||||
"@tanstack/react-query": "5.100.14",
|
||||
@@ -32,16 +31,18 @@
|
||||
"derive-valtio": "0.2.0",
|
||||
"hoofd": "1.7.3",
|
||||
"humanize-duration": "3.33.2",
|
||||
"i18next": "26.2.0",
|
||||
"i18next": "26.3.1",
|
||||
"i18next-browser-languagedetector": "8.2.1",
|
||||
"i18next-parser": "9.4.0",
|
||||
"i18next-resources-to-backend": "1.2.1",
|
||||
"livekit-client": "2.19.0",
|
||||
"posthog-js": "1.376.0",
|
||||
"posthog-js": "1.386.5",
|
||||
"react": "18.3.1",
|
||||
"react-aria-components": "1.14.0",
|
||||
"react-aria": "3.49.0",
|
||||
"react-aria-components": "1.18.0",
|
||||
"react-dom": "18.3.1",
|
||||
"react-i18next": "17.0.8",
|
||||
"react-stately": "3.47.0",
|
||||
"use-sound": "5.0.0",
|
||||
"valtio": "2.3.2",
|
||||
"wouter": "3.10.0"
|
||||
@@ -52,6 +53,7 @@
|
||||
"@tanstack/eslint-plugin-query": "5.100.14",
|
||||
"@tanstack/react-query-devtools": "5.100.14",
|
||||
"@types/humanize-duration": "3.27.4",
|
||||
"@types/node": "24.12.4",
|
||||
"@types/react": "18.3.12",
|
||||
"@types/react-dom": "18.3.1",
|
||||
"@vitejs/plugin-react": "6.0.2",
|
||||
|
||||
@@ -9,6 +9,7 @@ export interface ApiConfig {
|
||||
analytics?: {
|
||||
id: string
|
||||
host: string
|
||||
flags_api_host?: string
|
||||
}
|
||||
support?: {
|
||||
id: string
|
||||
|
||||
@@ -28,10 +28,16 @@ export const terminateAnalyticsSession = async () => {
|
||||
export type useAnalyticsProps = {
|
||||
id?: string
|
||||
host?: string
|
||||
flags_api_host?: string
|
||||
isDisabled?: boolean
|
||||
}
|
||||
|
||||
export const useAnalytics = ({ id, host, isDisabled }: useAnalyticsProps) => {
|
||||
export const useAnalytics = ({
|
||||
id,
|
||||
host,
|
||||
flags_api_host,
|
||||
isDisabled,
|
||||
}: useAnalyticsProps) => {
|
||||
const [location] = useLocation()
|
||||
const { user } = useUser()
|
||||
|
||||
@@ -39,9 +45,13 @@ export const useAnalytics = ({ id, host, isDisabled }: useAnalyticsProps) => {
|
||||
if (!id || !host || isDisabled) return
|
||||
getPosthog().then((ph) => {
|
||||
if (ph.__loaded) return
|
||||
ph.init(id, { api_host: host, person_profiles: 'always' })
|
||||
ph.init(id, {
|
||||
api_host: host,
|
||||
flags_api_host: flags_api_host,
|
||||
person_profiles: 'always',
|
||||
})
|
||||
})
|
||||
}, [id, host, isDisabled])
|
||||
}, [id, host, flags_api_host, isDisabled])
|
||||
|
||||
useEffect(() => {
|
||||
if (!user) return
|
||||
|
||||
@@ -44,7 +44,8 @@ export function PaginationControl({
|
||||
if (totalPageCount <= 1) return null
|
||||
|
||||
return (
|
||||
<div
|
||||
<nav
|
||||
aria-label={t('label')}
|
||||
className={css({
|
||||
position: 'absolute',
|
||||
bottom: '1rem',
|
||||
@@ -74,7 +75,7 @@ export function PaginationControl({
|
||||
<RiArrowLeftSLine />
|
||||
</Button>
|
||||
<span
|
||||
aria-live="polite"
|
||||
role="status"
|
||||
className={css({
|
||||
padding: '0.25rem 0.5rem',
|
||||
})}
|
||||
@@ -93,6 +94,6 @@ export function PaginationControl({
|
||||
>
|
||||
<RiArrowRightSLine />
|
||||
</Button>
|
||||
</div>
|
||||
</nav>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { Button } from '@/primitives'
|
||||
import { RiCloseLine } from '@remixicon/react'
|
||||
import { useRef } from 'react'
|
||||
import type { ToastState } from '@react-stately/toast'
|
||||
import type { ToastState } from 'react-stately'
|
||||
import type { ToastData } from './ToastProvider'
|
||||
import type { QueuedToast } from '@react-stately/toast'
|
||||
import type { QueuedToast } from 'react-stately'
|
||||
import { StyledToastContainer } from './StyledToastContainer'
|
||||
import { StyledToast } from './StyledToast'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useMemo, useRef } from 'react'
|
||||
|
||||
import type { ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useRef } from 'react'
|
||||
import { Button as RACButton } from 'react-aria-components'
|
||||
import { Track } from 'livekit-client'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useEffect, useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useMemo, useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable react-refresh/only-export-components */
|
||||
import { ToastQueue, useToastQueue } from '@react-stately/toast'
|
||||
import { ToastQueue, useToastQueue } from 'react-stately'
|
||||
import { ToastRegion } from './ToastRegion'
|
||||
import { Participant } from 'livekit-client'
|
||||
import type { NotificationType } from '../NotificationType'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useMemo, useRef } from 'react'
|
||||
|
||||
import { type ToastProps } from './Toast'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useToast } from '@react-aria/toast'
|
||||
import { useToast } from 'react-aria'
|
||||
import { useMemo, useRef } from 'react'
|
||||
import { Text } from '@/primitives'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AriaToastRegionProps, useToastRegion } from '@react-aria/toast'
|
||||
import type { QueuedToast, ToastState } from '@react-stately/toast'
|
||||
import { AriaToastRegionProps, useToastRegion } from 'react-aria'
|
||||
import type { QueuedToast, ToastState } from 'react-stately'
|
||||
import { Toast } from './Toast'
|
||||
import { useRef } from 'react'
|
||||
import { NotificationType } from '../NotificationType'
|
||||
|
||||
@@ -68,7 +68,7 @@ export const PipView = () => {
|
||||
</ConnectionStateWrapper>
|
||||
<PipStage />
|
||||
<ReactionsToolbar adjustedCentering={false} />
|
||||
<PipControlBar showScreenShare={false} />
|
||||
<PipControlBar showScreenShare={true} />
|
||||
<PipFloatingReactions />
|
||||
<NotificationProvider bottom={30} />
|
||||
</Container>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { RiMoreFill } from '@remixicon/react'
|
||||
import { FocusScope } from '@react-aria/focus'
|
||||
import { FocusScope } from 'react-aria'
|
||||
import { Box, Button } from '@/primitives'
|
||||
import { css } from '@/styled-system/css'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { styled } from '@/styled-system/jsx'
|
||||
|
||||
interface PipPaginationProps {
|
||||
totalPageCount: number
|
||||
currentPage: number
|
||||
nextPage: () => void
|
||||
prevPage: () => void
|
||||
}
|
||||
|
||||
export const PipPagination = ({
|
||||
totalPageCount,
|
||||
currentPage,
|
||||
nextPage,
|
||||
prevPage,
|
||||
}: PipPaginationProps) => {
|
||||
const { t } = useTranslation('rooms', { keyPrefix: 'pagination' })
|
||||
|
||||
if (totalPageCount <= 1) return null
|
||||
|
||||
return (
|
||||
<Nav aria-label={t('label')}>
|
||||
<ArrowButton
|
||||
type="button"
|
||||
onClick={prevPage}
|
||||
disabled={currentPage === 1}
|
||||
aria-label={t('previous')}
|
||||
>
|
||||
<RiArrowLeftSLine size={18} />
|
||||
</ArrowButton>
|
||||
<Counter role="status">
|
||||
{t('count', { currentPage, totalPageCount })}
|
||||
</Counter>
|
||||
<ArrowButton
|
||||
type="button"
|
||||
onClick={nextPage}
|
||||
disabled={currentPage === totalPageCount}
|
||||
aria-label={t('next')}
|
||||
>
|
||||
<RiArrowRightSLine size={18} />
|
||||
</ArrowButton>
|
||||
</Nav>
|
||||
)
|
||||
}
|
||||
|
||||
const Nav = styled('nav', {
|
||||
base: {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: '0.25rem',
|
||||
marginTop: '1rem',
|
||||
flexShrink: 0,
|
||||
},
|
||||
})
|
||||
|
||||
const ArrowButton = styled('button', {
|
||||
base: {
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
width: '1.75rem',
|
||||
height: '1.75rem',
|
||||
borderRadius: '4px',
|
||||
border: 'none',
|
||||
cursor: 'pointer',
|
||||
color: 'white',
|
||||
backgroundColor: 'primaryDark.100',
|
||||
transition: 'opacity 0.15s, background-color 0.15s',
|
||||
'&:hover:not(:disabled)': {
|
||||
backgroundColor: 'primaryDark.75',
|
||||
},
|
||||
'&:focus-visible': {
|
||||
outline: '2px solid',
|
||||
outlineColor: 'white',
|
||||
outlineOffset: '2px',
|
||||
},
|
||||
'&:disabled': {
|
||||
opacity: 0.3,
|
||||
cursor: 'default',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
const Counter = styled('span', {
|
||||
base: {
|
||||
fontSize: '0.75rem',
|
||||
color: 'white',
|
||||
opacity: 0.8,
|
||||
whiteSpace: 'nowrap',
|
||||
padding: '0 0.25rem',
|
||||
minWidth: '3rem',
|
||||
textAlign: 'center',
|
||||
},
|
||||
})
|
||||
@@ -1,9 +1,12 @@
|
||||
import { useMemo } from 'react'
|
||||
import { useTracks } from '@livekit/components-react'
|
||||
import { usePagination, useTracks } from '@livekit/components-react'
|
||||
import { RoomEvent, Track } from 'livekit-client'
|
||||
import { styled } from '@/styled-system/jsx'
|
||||
import { PipFocusLayout } from './PipFocusLayout'
|
||||
import { PipGridLayout } from './PipGridLayout'
|
||||
import { PipPagination } from './PipPagination'
|
||||
import { StageFrame } from './StageFrame'
|
||||
import { MAX_PIP_TILES } from '../../utils/pipGrid'
|
||||
import {
|
||||
isTrackReference,
|
||||
TrackReferenceOrPlaceholder,
|
||||
@@ -38,21 +41,38 @@ export const PipStage = () => {
|
||||
[tracks]
|
||||
)
|
||||
|
||||
// Grid mode order: screen share leads, then cameras (already ordered by
|
||||
// active speaker via the `ActiveSpeakersChanged` update above).
|
||||
const gridTracks = useMemo(
|
||||
() =>
|
||||
screenShareTrack ? [screenShareTrack, ...cameraTracks] : cameraTracks,
|
||||
[screenShareTrack, cameraTracks]
|
||||
)
|
||||
|
||||
// Cap the grid at MAX_PIP_TILES per page. `usePagination` keeps the visible
|
||||
// page visually stable (active/recent speakers stay put) via its internal
|
||||
// `useVisualStableUpdate`. Called unconditionally to respect hook rules.
|
||||
const pagination = usePagination(MAX_PIP_TILES, gridTracks)
|
||||
|
||||
if (tracks.length === 0) return null
|
||||
|
||||
/**
|
||||
* The focus layout shows one main track with one thumbnail overlay,
|
||||
* so it can only fit 2 tracks. Beyond that we switch to the grid.
|
||||
*/
|
||||
if (tracks.length > 2) {
|
||||
// Grid mode: 3+ tracks. Screen share goes first so it leads the grid.
|
||||
const gridTracks = screenShareTrack
|
||||
? [screenShareTrack, ...cameraTracks]
|
||||
: cameraTracks
|
||||
if (gridTracks.length > 2) {
|
||||
return (
|
||||
<StageFrame>
|
||||
<PipGridLayout tracks={gridTracks} />
|
||||
</StageFrame>
|
||||
<StageWrapper>
|
||||
<StageFrame>
|
||||
<PipGridLayout tracks={pagination.tracks} />
|
||||
</StageFrame>
|
||||
<PipPagination
|
||||
totalPageCount={pagination.totalPageCount}
|
||||
currentPage={pagination.currentPage}
|
||||
nextPage={pagination.nextPage}
|
||||
prevPage={pagination.prevPage}
|
||||
/>
|
||||
</StageWrapper>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -75,3 +95,12 @@ export const PipStage = () => {
|
||||
</StageFrame>
|
||||
)
|
||||
}
|
||||
|
||||
const StageWrapper = styled('div', {
|
||||
base: {
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
minWidth: 0,
|
||||
minHeight: 0,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { styled } from '@/styled-system/jsx'
|
||||
import { useLocalParticipant } from '@livekit/components-react'
|
||||
|
||||
export const StageFrame = ({ children }: { children: React.ReactNode }) => {
|
||||
const { t } = useTranslation('rooms', {
|
||||
keyPrefix: 'pictureInPicture',
|
||||
})
|
||||
const { localParticipant } = useLocalParticipant()
|
||||
|
||||
return (
|
||||
<Container role="region" aria-label={t('stage')} {...{ inert: '' }}>
|
||||
<Container
|
||||
role="region"
|
||||
aria-label={t('stage')}
|
||||
{...(!localParticipant.isScreenShareEnabled ? { inert: '' } : {})}
|
||||
>
|
||||
{children}
|
||||
</Container>
|
||||
)
|
||||
@@ -15,6 +22,7 @@ export const StageFrame = ({ children }: { children: React.ReactNode }) => {
|
||||
const Container = styled('div', {
|
||||
base: {
|
||||
position: 'relative',
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
minHeight: 0,
|
||||
marginLeft: '0.5rem',
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/**
|
||||
* Maximum number of tiles rendered per PiP page. Beyond this the grid
|
||||
* paginates so large meetings stay glanceable (active speaker priority)
|
||||
* instead of subscribing to and rendering every camera in a small window.
|
||||
*/
|
||||
export const MAX_PIP_TILES = 5
|
||||
|
||||
export type PipTilePlacement = {
|
||||
gridColumn: string
|
||||
gridRow: number
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useSize } from '@/features/rooms/livekit/hooks/useResizeObserver'
|
||||
import { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react'
|
||||
import { Button } from '@/primitives'
|
||||
import { ReactionsKeyboardNavigation } from './ReactionsKeyboardNavigation'
|
||||
import { FocusScope } from '@react-aria/focus'
|
||||
import { FocusScope } from 'react-aria'
|
||||
|
||||
import { CONTROL_BAR_REGION_ID } from '@/features/layout/components/ControlBarRegion'
|
||||
import { REACTIONS_TOGGLE_ID } from '../ReactionsToggle'
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useFocusManager } from '@react-aria/focus'
|
||||
import { useFocusManager } from 'react-aria'
|
||||
import { getFirstControlBarFocusable } from '@/utils/dom'
|
||||
import { REACTIONS_TOOLBAR_ID } from '../../constants'
|
||||
import { useReactionsToolbar } from '../../hooks/useReactionsToolbar'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { css } from '@/styled-system/css'
|
||||
import { Button, Text } from '@/primitives'
|
||||
import { useMemo, useRef } from 'react'
|
||||
import { useCallback, useMemo, useRef } from 'react'
|
||||
import { screenSharePreferenceStore } from '@/stores/screenSharePreferences'
|
||||
import { useSnapshot } from 'valtio'
|
||||
import { useLocalParticipant } from '@livekit/components-react'
|
||||
@@ -61,9 +61,19 @@ export const FullScreenShareWarning = ({
|
||||
await localParticipant.setScreenShareEnabled(false, {}, {})
|
||||
}
|
||||
|
||||
const handleDismissWarning = () => {
|
||||
const handleDismissWarning = useCallback(() => {
|
||||
screenSharePreferenceStore.enabled = false
|
||||
}
|
||||
}, [])
|
||||
|
||||
const handleKeyDown = useCallback(
|
||||
(e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
e.stopPropagation()
|
||||
handleDismissWarning()
|
||||
}
|
||||
},
|
||||
[handleDismissWarning]
|
||||
)
|
||||
|
||||
if (!shouldShowWarning) return null
|
||||
|
||||
@@ -98,6 +108,7 @@ export const FullScreenShareWarning = ({
|
||||
})}
|
||||
>
|
||||
<Text
|
||||
role="alert"
|
||||
style={{
|
||||
color: 'white',
|
||||
flexBasis: '55%',
|
||||
@@ -117,11 +128,14 @@ export const FullScreenShareWarning = ({
|
||||
})}
|
||||
>
|
||||
<Button
|
||||
// eslint-disable-next-line jsx-a11y/no-autofocus
|
||||
autoFocus
|
||||
variant="tertiary"
|
||||
size="sm"
|
||||
style={{
|
||||
height: 'fit-content',
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
onPress={async () => {
|
||||
await handleStopScreenShare()
|
||||
}}
|
||||
@@ -134,6 +148,7 @@ export const FullScreenShareWarning = ({
|
||||
style={{
|
||||
height: 'fit-content',
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
onPress={() => handleDismissWarning()}
|
||||
>
|
||||
{t('ignore')}
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
}
|
||||
},
|
||||
"pagination": {
|
||||
"label": "Teilnehmerseiten",
|
||||
"count": "{{currentPage}} von {{totalPageCount}}",
|
||||
"next": "nächste Seite",
|
||||
"previous": "vorherige Seite"
|
||||
@@ -432,10 +433,10 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Premium-Funktion",
|
||||
"heading": "Advanced-Funktion",
|
||||
"body": "Diese Funktion ist für Sie nicht verfügbar. Bitte wenden Sie sich an den Support, um weitere Informationen zu erhalten.",
|
||||
"linkMore": "Dokumentation öffnen",
|
||||
"linkAriaLabel": "Dokumentation zum Premium-Zugang öffnen – öffnet in neuem Tab",
|
||||
"linkAriaLabel": "Dokumentation zum Advanced-Zugang öffnen – öffnet in neuem Tab",
|
||||
"dividerLabel": "ODER",
|
||||
"login": {
|
||||
"heading": "Anmeldung erforderlich",
|
||||
@@ -485,10 +486,10 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Premium-Funktion",
|
||||
"heading": "Advanced-Funktion",
|
||||
"body": "Diese Funktion ist für Sie nicht verfügbar. Bitte wenden Sie sich an den Support, um weitere Informationen zu erhalten.",
|
||||
"linkMore": "Dokumentation öffnen",
|
||||
"linkAriaLabel": "Dokumentation zum Premium-Zugang öffnen – öffnet in neuem Tab",
|
||||
"linkAriaLabel": "Dokumentation zum Advanced-Zugang öffnen – öffnet in neuem Tab",
|
||||
"dividerLabel": "ODER",
|
||||
"login": {
|
||||
"heading": "Anmeldung erforderlich",
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
}
|
||||
},
|
||||
"pagination": {
|
||||
"label": "Participants pages",
|
||||
"count": "{{currentPage}} of {{totalPageCount}}",
|
||||
"next": "next page",
|
||||
"previous": "previous page"
|
||||
@@ -431,10 +432,10 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Premium feature",
|
||||
"heading": "Advanced feature",
|
||||
"body": "This feature is not available to you. Please contact support for more information.",
|
||||
"linkMore": "Open documentation",
|
||||
"linkAriaLabel": "Open documentation about premium access - opens in new window",
|
||||
"linkAriaLabel": "Open documentation about advanced access - opens in new window",
|
||||
"dividerLabel": "OR",
|
||||
"login": {
|
||||
"heading": "You are not logged in!",
|
||||
@@ -484,10 +485,10 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Premium feature",
|
||||
"heading": "Advanced feature",
|
||||
"body": "This feature is not available to you. Please contact support for more information.",
|
||||
"linkMore": "Open documentation",
|
||||
"linkAriaLabel": "Open documentation about premium access - opens in new window",
|
||||
"linkAriaLabel": "Open documentation about advanced access - opens in new window",
|
||||
"dividerLabel": "OR",
|
||||
"login": {
|
||||
"heading": "You are not logged in!",
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
}
|
||||
},
|
||||
"pagination": {
|
||||
"label": "Pages des participants",
|
||||
"count": "{{currentPage}} sur {{totalPageCount}}",
|
||||
"next": "page suivante",
|
||||
"previous": "page précédente"
|
||||
@@ -431,7 +432,7 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Fonctionnalité premium",
|
||||
"heading": "Fonctionnalité avancée",
|
||||
"body": "Cette fonctionnalité ne vous est pas ouverte. Contactez le support pour obtenir plus d'informations.",
|
||||
"linkMore": "Ouvrir la documentation",
|
||||
"dividerLabel": "OU",
|
||||
@@ -444,7 +445,7 @@
|
||||
"body": "L'hôte recevra une notification et pourra démarrer la transcription pour vous.",
|
||||
"buttonLabel": "Demander"
|
||||
},
|
||||
"linkAriaLabel": "Ouvrir la documentation sur l'accès premium - ouvre dans une nouvelle fenêtre"
|
||||
"linkAriaLabel": "Ouvrir la documentation sur la fonctionnalité avancée - ouvre dans une nouvelle fenêtre"
|
||||
}
|
||||
},
|
||||
"screenRecording": {
|
||||
@@ -484,7 +485,7 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Fonctionnalité premium",
|
||||
"heading": "Fonctionnalité avancée",
|
||||
"body": "Cette fonctionnalité ne vous est pas ouverte. Contactez le support pour obtenir plus d'informations.",
|
||||
"linkMore": "Ouvrir la documentation",
|
||||
"dividerLabel": "OU",
|
||||
@@ -497,7 +498,7 @@
|
||||
"body": "L'hôte recevra une notification et pourra démarrer l'enregistrement pour vous.",
|
||||
"buttonLabel": "Demander"
|
||||
},
|
||||
"linkAriaLabel": "Ouvrir la documentation sur l'accès premium - ouvre dans une nouvelle fenêtre"
|
||||
"linkAriaLabel": "Ouvrir la documentation sur la fonctionnalité avancée - ouvre dans une nouvelle fenêtre"
|
||||
},
|
||||
"durationMessage": "(limité à {{max_duration}}) "
|
||||
},
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
}
|
||||
},
|
||||
"pagination": {
|
||||
"label": "Pagina's van deelnemers",
|
||||
"count": "{{currentPage}} van {{totalPageCount}}",
|
||||
"next": "volgende pagina",
|
||||
"previous": "vorige pagina"
|
||||
@@ -431,10 +432,10 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Premiumfunctie",
|
||||
"heading": "Geavanceerde functie",
|
||||
"body": "Deze functie is niet voor u beschikbaar. Neem contact op met de ondersteuning voor meer informatie.",
|
||||
"linkMore": "Documentatie openen",
|
||||
"linkAriaLabel": "Documentatie over premiumtoegang openen - opent in nieuw venster",
|
||||
"linkAriaLabel": "Documentatie over Geavanceerde functie openen - opent in nieuw venster",
|
||||
"dividerLabel": "OF",
|
||||
"login": {
|
||||
"heading": "Inloggen vereist",
|
||||
@@ -484,10 +485,10 @@
|
||||
}
|
||||
},
|
||||
"premium": {
|
||||
"heading": "Premiumfunctie",
|
||||
"heading": "Geavanceerde functie",
|
||||
"body": "Deze functie is niet voor u beschikbaar. Neem contact op met de ondersteuning voor meer informatie.",
|
||||
"linkMore": "Documentatie openen",
|
||||
"linkAriaLabel": "Documentatie over premiumtoegang openen - opent in nieuw venster",
|
||||
"linkAriaLabel": "Documentatie over Geavanceerde functie openen - opent in nieuw venster",
|
||||
"dividerLabel": "OF",
|
||||
"login": {
|
||||
"heading": "Inloggen vereist",
|
||||
|
||||
@@ -53,6 +53,12 @@ _summaryEnvVars: &summaryEnvVars
|
||||
CELERY_BROKER_URL: redis://default:pass@redis-master:6379/1
|
||||
CELERY_RESULT_BACKEND: redis://default:pass@redis-master:6379/1
|
||||
TASK_TRACKER_REDIS_URL: redis://default:pass@redis-master:6379/1
|
||||
IS_RESOLVE_SPEAKER_IDENTITIES_ENABLED: true
|
||||
RESOLVE_SPEAKER_IDENTITIES_DEFAULT_OVERLAP: 0.5
|
||||
RESOLVE_SPEAKER_ENABLE_SPLIT_ON_WORDS: true
|
||||
RESOLVE_SPEAKER_MAX_WORD_DURATION: 1
|
||||
POSTHOG_API_KEY: your-posthog-key
|
||||
POSTHOG_ENABLED: False
|
||||
|
||||
_summaryImage: &summaryImage
|
||||
repository: localhost:5001/meet-summary
|
||||
|
||||
@@ -28,6 +28,7 @@ agentSubtitles:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ENABLE_SILERO_VAD: "false"
|
||||
STT_PROVIDER: kyutai
|
||||
|
||||
image:
|
||||
repository: localhost:5001/meet-agents
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
apiVersion: v2
|
||||
type: application
|
||||
name: meet
|
||||
version: 0.0.25
|
||||
version: 0.0.26
|
||||
|
||||
@@ -72,11 +72,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "meet.posthog.fullname" . }}-proxy
|
||||
name: {{ include "meet.posthog.fullname" $ }}-proxy
|
||||
port:
|
||||
number: {{ $.Values.posthog.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "meet.posthog.fullname" . }}-proxy
|
||||
serviceName: {{ include "meet.posthog.fullname" $ }}-proxy
|
||||
servicePort: {{ $.Values.posthog.service.port }}
|
||||
{{- end }}
|
||||
{{- with $.Values.posthog.assetsService.customBackends }}
|
||||
|
||||
@@ -72,11 +72,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "meet.posthog.fullname" . }}-assets-proxy
|
||||
name: {{ include "meet.posthog.fullname" $ }}-assets-proxy
|
||||
port:
|
||||
number: {{ $.Values.posthog.assetsService.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "meet.posthog.fullname" . }}-assets-proxy
|
||||
serviceName: {{ include "meet.posthog.fullname" $ }}-assets-proxy
|
||||
servicePort: {{ $.Values.posthog.assetsService.service.port }}
|
||||
{{- end }}
|
||||
{{- with $.Values.posthog.assetsService.customBackends }}
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "mail_mjml",
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mail_mjml",
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@html-to/text-cli": "0.5.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mail_mjml",
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"description": "An util to generate html and text django's templates from mjml templates",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "sdk",
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sdk",
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"license": "ISC",
|
||||
"workspaces": [
|
||||
"./library",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sdk",
|
||||
"version": "1.21.0",
|
||||
"version": "1.22.0",
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
FROM python:3.13-alpine3.23 AS base
|
||||
FROM python:3.13-alpine3.24 AS base
|
||||
|
||||
|
||||
# Install ffmpeg for audio/video processing (format conversion, extraction, compression)
|
||||
# See summary/core/file_service.py for usage.
|
||||
RUN apk add --no-cache "ffmpeg=8.0.1-r1"
|
||||
RUN apk add --no-cache "ffmpeg=8.1.2-r0"
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
[project]
|
||||
name = "summary"
|
||||
version = "1.21.0"
|
||||
version = "1.22.0"
|
||||
dependencies = [
|
||||
"fastapi[standard]>=0.105.0",
|
||||
"uvicorn>=0.24.0",
|
||||
@@ -10,17 +10,17 @@ dependencies = [
|
||||
"celery==5.6.3",
|
||||
"redis==5.2.1",
|
||||
"minio==7.2.20",
|
||||
"openai==2.38.0",
|
||||
"posthog==7.15.4",
|
||||
"openai==2.44.0",
|
||||
"posthog==7.20.5",
|
||||
"requests==2.34.2",
|
||||
"sentry-sdk[fastapi, celery]==2.60.0",
|
||||
"langfuse==4.6.1"
|
||||
"sentry-sdk[fastapi, celery]==2.63.0",
|
||||
"langfuse==4.11.0"
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"ruff==0.15.14",
|
||||
"pytest==9.0.3",
|
||||
"ruff==0.15.19",
|
||||
"pytest==9.1.1",
|
||||
"responses>=0.25.8",
|
||||
]
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ class MediaInfo:
|
||||
has_video: bool
|
||||
audio_duration_seconds: float | None
|
||||
audio_codec_name: str | None
|
||||
has_bad_stream: bool = False
|
||||
|
||||
|
||||
def get_media_info(local_path: Path) -> MediaInfo:
|
||||
@@ -174,8 +175,9 @@ def get_media_info(local_path: Path) -> MediaInfo:
|
||||
data = json.loads(result.stdout)
|
||||
|
||||
streams = data.get("streams", [])
|
||||
has_audio = any(el["codec_type"] == "audio" for el in streams)
|
||||
has_video = any(el["codec_type"] == "video" for el in streams)
|
||||
has_audio = any(el.get("codec_type") == "audio" for el in streams)
|
||||
has_video = any(el.get("codec_type") == "video" for el in streams)
|
||||
has_bad_stream = any(el.get("codec_type", None) is None for el in streams)
|
||||
audio_codec_name = next(
|
||||
(
|
||||
stream.get("codec_name")
|
||||
@@ -193,10 +195,11 @@ def get_media_info(local_path: Path) -> MediaInfo:
|
||||
has_video=has_video,
|
||||
audio_duration_seconds=audio_duration_seconds,
|
||||
audio_codec_name=audio_codec_name,
|
||||
has_bad_stream=has_bad_stream,
|
||||
)
|
||||
|
||||
|
||||
def extract_audio_from_video(media_info: MediaInfo) -> Path:
|
||||
def extract_audio_from_media(media_info: MediaInfo) -> Path:
|
||||
"""Extracts the audio track from a video file and saves it as a separate audio file.
|
||||
|
||||
Based on the provided audio codec,
|
||||
@@ -451,7 +454,12 @@ class FileService:
|
||||
|
||||
if media_info.has_video:
|
||||
logger.info("Video file detected, extracting audio...")
|
||||
processed_path = extract_audio_from_video(media_info)
|
||||
processed_path = extract_audio_from_media(media_info)
|
||||
# Bad streams may cause transcription issues on WhisperX,
|
||||
# So we extract the audio properly
|
||||
elif media_info.has_bad_stream:
|
||||
logger.info("Bad stream detected, extracting audio...")
|
||||
processed_path = extract_audio_from_media(media_info)
|
||||
else:
|
||||
processed_path = downloaded_path
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
"""Unit tests for the file service."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
|
||||
from summary.core import file_service
|
||||
from summary.core.file_service import (
|
||||
MediaInfo,
|
||||
extract_audio_from_video,
|
||||
extract_audio_from_media,
|
||||
get_media_info,
|
||||
)
|
||||
|
||||
@@ -110,12 +113,40 @@ def test_media_info_invalid_file() -> None:
|
||||
)
|
||||
|
||||
|
||||
def test_media_info_ignores_empty_stream_entry(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Test stream parsing when ffprobe returns an empty stream object."""
|
||||
ffprobe_payload = {
|
||||
"programs": [],
|
||||
"stream_groups": [],
|
||||
"streams": [
|
||||
{"codec_name": "vorbis", "codec_type": "audio"},
|
||||
{},
|
||||
],
|
||||
}
|
||||
|
||||
run_mock = Mock(
|
||||
return_value=Mock(stdout=json.dumps(ffprobe_payload), stderr="", returncode=0)
|
||||
)
|
||||
monkeypatch.setattr(file_service.subprocess, "run", run_mock)
|
||||
monkeypatch.setattr(
|
||||
file_service, "get_media_duration_seconds", Mock(return_value=2.5)
|
||||
)
|
||||
|
||||
media_info = get_media_info(BASE_PATH / "audio-sample-android-firefox.ogg")
|
||||
|
||||
assert media_info.has_audio is True
|
||||
assert media_info.has_video is False
|
||||
assert media_info.has_bad_stream is True
|
||||
assert media_info.audio_codec_name == "vorbis"
|
||||
assert media_info.audio_duration_seconds == 2.5
|
||||
|
||||
|
||||
def test_extract_audio_from_video():
|
||||
"""Test that extract_audio_from_video can extract audio from a video file."""
|
||||
path = None
|
||||
# A bit of cleanup logic since this is not a generator
|
||||
try:
|
||||
path = extract_audio_from_video(MEDIA_INFO_SAMPLE_VISIO)
|
||||
path = extract_audio_from_media(MEDIA_INFO_SAMPLE_VISIO)
|
||||
assert path.name.endswith(".m4a")
|
||||
except Exception as e:
|
||||
pytest.fail(f"Failed to extract audio from video: {e}")
|
||||
|
||||
Reference in New Issue
Block a user