Compare commits

..

6 Commits

Author SHA1 Message Date
Florent Chehab a5b79afde1 ⚰️(summary) cleaned tasks failure handling
Code in task failure was assuming that the failure
signal would be called on retry which is not the case.
2026-07-24 12:07:44 +02:00
Florent Chehab 052d3c1b22 (summary) report exception type in failure analytics
We know capture also the exception type that was raised
in failure analytics to provide more insights about what happened.
2026-07-24 10:14:59 +02:00
Florent Chehab dff5aa9575 🐛(summary) properly detect if task will be retried
In previous version, webhook may not be called in case of failure,
because the task wouldn't be actually retried.
We know check the exception raised against the auto_retry for
config.
Analytics capture also happens in case of definitive failure.
2026-07-24 10:02:39 +02:00
Florent Chehab ded93bf24f 🐛(summary) retry on RequestException instead of HTTPError
Request may fail for other reasons than HTTPError (ConnectionError for
instance). This change switches to the more generalized error for the
retry logic on call webhook & transcribe audio
2026-07-24 09:58:58 +02:00
leo 5ba1885411 (transcription) fix broken speaker assignment tests
Fix broken speaker assignement tests following #1522.
2026-07-22 14:23:10 +02:00
snyk-bot 273af221e6 ⬆️(frontend) upgrade livekit-client from 2.19.2 to 2.20.0
Snyk has created this PR to upgrade livekit-client from 2.19.2 to 2.20.0.

See this package in npm:
livekit-client

See this project in Snyk:
https://app.eu.snyk.io/org/lasuite-dinum-default/project/96ea03d8-8d09-493d-86bf-363f274e129e?utm_source=github&utm_medium=referral&page=upgrade-pr
2026-07-21 19:00:04 +02:00
5 changed files with 62 additions and 70 deletions
+7
View File
@@ -8,9 +8,15 @@ and this project adheres to
## [Unreleased]
### Added
- ✨(summary) report exception type in failure analytics
## Fixed
- 🐛(transcription) fix silent bug in speaker assignment
- 🐛(summary) extend tasks auto retry logic
- 🐛(summary) properly detect when failure webhook should be sent
### Changed
@@ -18,6 +24,7 @@ and this project adheres to
- ⬆️(frontend) upgrade i18next from 26.3.1 to 26.3.2
- ⬆️(frontend) upgrade posthog-js from 1.391.2 to 1.395.0
- ⬆️(frontend) upgrade @tanstack/react-query from 5.101.0 to 5.101.1
- ⬆️(frontend) upgrade livekit-client from 2.19.2 to 2.20.0
## [1.24.0] - 2026-07-21
+8 -8
View File
@@ -29,7 +29,7 @@
"i18next-browser-languagedetector": "8.2.1",
"i18next-parser": "9.4.0",
"i18next-resources-to-backend": "1.2.1",
"livekit-client": "2.19.2",
"livekit-client": "2.20.0",
"posthog-js": "1.395.0",
"react": "18.3.1",
"react-aria": "3.50.0",
@@ -1028,9 +1028,9 @@
"license": "Apache-2.0"
},
"node_modules/@livekit/protocol": {
"version": "1.45.8",
"resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.45.8.tgz",
"integrity": "sha512-Q+l57E7w/xxOBFVWzdX5rkAZO7ffyF+rlDzNUYq2SU114+5aTyCq+PK4unaEVDNd4952Af7wteKr3sOgasGuaA==",
"version": "1.46.6",
"resolved": "https://registry.npmjs.org/@livekit/protocol/-/protocol-1.46.6.tgz",
"integrity": "sha512-upzlHP1vi/kZ/QqALZTFskQ0ifqc2f15RKucHYOsIHJsaXvEYanG75mAb7o+Yomfs4XhQ4BaRsdY+TFHXpaqrg==",
"license": "Apache-2.0",
"dependencies": {
"@bufbuild/protobuf": "^1.10.0"
@@ -8125,13 +8125,13 @@
"license": "MIT"
},
"node_modules/livekit-client": {
"version": "2.19.2",
"resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.19.2.tgz",
"integrity": "sha512-Kvk07QYDWRAbmYNLRll04ZIuxMQobW/oLPYnmR1kCy8GGHpU0gqyHf704Rz+29zfy8IJZRjKqeVbzGSKn9sumw==",
"version": "2.20.0",
"resolved": "https://registry.npmjs.org/livekit-client/-/livekit-client-2.20.0.tgz",
"integrity": "sha512-RIJcpvBmOmwz3jTj3rmdY6Dzr55HrhcaJjMgY+HSmoEM+yIRyA40m7r8UKv0hnZWM3z/AYhP1q8C8ciz5UWFKQ==",
"license": "Apache-2.0",
"dependencies": {
"@livekit/mutex": "1.1.1",
"@livekit/protocol": "1.45.8",
"@livekit/protocol": "1.46.6",
"events": "^3.3.0",
"jose": "^6.1.0",
"loglevel": "^1.9.2",
+1 -1
View File
@@ -36,7 +36,7 @@
"i18next-browser-languagedetector": "8.2.1",
"i18next-parser": "9.4.0",
"i18next-resources-to-backend": "1.2.1",
"livekit-client": "2.19.2",
"livekit-client": "2.20.0",
"posthog-js": "1.395.0",
"react": "18.3.1",
"react-aria": "3.50.0",
+4 -1
View File
@@ -202,13 +202,16 @@ class MetadataManager:
},
)
def capture(self, task_id, event_name):
def capture(self, task_id, event_name, extra_properties=None):
"""Capture analytics event with task metadata and clean up."""
if self._is_disabled or not self.has_task_id(task_id):
return
metadata = self._get_metadata(task_id)
if extra_properties:
metadata = {**metadata, **extra_properties}
if "start_time" in metadata:
metadata["execution_time"] = round(time.time() - metadata["start_time"], 2)
del metadata["start_time"]
+42 -60
View File
@@ -431,7 +431,7 @@ def _should_auto_create_summary(payload: TranscribeTaskJob) -> bool:
@celery.task(
max_retries=3,
queue=settings.call_webhook_queue_v2,
autoretry_for=[exceptions.HTTPError],
autoretry_for=[exceptions.RequestException],
)
def call_webhook_v2_task(
payload: dict,
@@ -445,7 +445,9 @@ def call_webhook_v2_task(
@celery.task(
bind=True,
autoretry_for=[exceptions.HTTPError],
autoretry_for=[
exceptions.RequestException,
],
max_retries=settings.celery_max_retries,
queue=settings.transcribe_queue_v2,
)
@@ -575,12 +577,6 @@ def task_retry_handler_transcript(request=None, reason=None, einfo=None, **kwarg
metadata_manager.retry(request.id)
@signals.task_failure.connect(sender=process_audio_transcribe_v2_task)
def task_failure_handler_transcript(task_id, exception=None, **kwargs):
"""Signal handler called when task execution fails permanently."""
metadata_manager.capture(task_id, settings.posthog_transcript_failure)
@signals.task_failure.connect(sender=process_audio_transcribe_v2_task)
def handle_transcribe_v2_failed(
sender,
@@ -594,30 +590,26 @@ def handle_transcribe_v2_failed(
):
"""Handle the failure of transcribe_v2_task.
This function is triggered when the transcribe_v2_task fails.
It sends a webhook failure payload to notify the client of the failure.
Tracks the failure event in analytics and sends a failure webhook to the client.
"""
n_retries_left = sender.max_retries - sender.request.retries - 1
if n_retries_left > 0:
logger.info(
"Transcribe task %s failed, %s retries left.",
task_id,
n_retries_left,
)
else:
logger.warn(
"Transcribe task %s failed, no more retries left, sending failure webhook.",
task_id,
)
call_webhook_v2_task.apply_async(
args=[
TranscribeWebhookFailurePayload(
job_id=task_id,
error_code="unknown_error",
).model_dump(),
args[0]["tenant_id"],
]
)
logger.error(
"Transcribe task %s failed, no more retries left, sending failure webhook.",
task_id,
)
metadata_manager.capture(
task_id,
settings.posthog_transcript_failure,
{"exception_type": type(exception).__name__},
)
call_webhook_v2_task.apply_async(
args=[
TranscribeWebhookFailurePayload(
job_id=task_id,
error_code="unknown_error",
).model_dump(),
args[0]["tenant_id"],
]
)
@celery.task(
@@ -681,12 +673,6 @@ def task_retry_handler_summary(request=None, reason=None, einfo=None, **kwargs):
metadata_manager.retry(request.id)
@signals.task_failure.connect(sender=summarize_v2_task)
def task_failure_handler_summary(task_id, exception=None, **kwargs):
"""Signal handler called when task execution fails permanently."""
metadata_manager.capture(task_id, settings.posthog_summary_failure)
@signals.task_failure.connect(sender=summarize_v2_task)
def handle_summarize_v2_failed(
sender,
@@ -700,27 +686,23 @@ def handle_summarize_v2_failed(
):
"""Handle the failure of summarize_v2_task.
This function is triggered when the summarize_v2_task fails.
It sends a webhook failure payload to notify the client of the failure.
Tracks the failure event in analytics and sends a failure webhook to the client.
"""
n_retries_left = sender.max_retries - sender.request.retries - 1
if n_retries_left > 0:
logger.info(
"Summary task %s failed, %s retries left.",
task_id,
n_retries_left,
)
else:
logger.warn(
"Summary task %s failed, no more retries left, sending failure webhook.",
task_id,
)
call_webhook_v2_task.apply_async(
args=[
SummarizeWebhookFailurePayload(
job_id=task_id,
error_code="unknown_error",
).model_dump(),
args[0]["tenant_id"],
]
)
logger.warn(
"Summary task %s failed, no more retries left, sending failure webhook.",
task_id,
)
metadata_manager.capture(
task_id,
settings.posthog_summary_failure,
{"exception_type": type(exception).__name__},
)
call_webhook_v2_task.apply_async(
args=[
SummarizeWebhookFailurePayload(
job_id=task_id,
error_code="unknown_error",
).model_dump(),
args[0]["tenant_id"],
]
)