Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(media-api): handle retries on existing UUIDs (#5320)

Hassieb Pakzadda147ea5aaf8
diff --git a/web/src/pages/api/public/media/index.ts b/web/src/pages/api/public/media/index.ts
index 2e12a7ccdb..b5f6d6b5e3 100644
--- a/web/src/pages/api/public/media/index.ts
+++ b/web/src/pages/api/public/media/index.ts
@@ -81,7 +81,8 @@ export default withMiddlewares({
};
}
- const mediaId = getMediaId({ projectId, sha256Hash });
+ const mediaId =
+ existingMedia?.id ?? getMediaId({ projectId, sha256Hash });
if (!env.LANGFUSE_S3_MEDIA_UPLOAD_BUCKET)
throw new InternalServerError(