Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Use internal signed URLs and improve retry UI
Richie McIlroy8464bd502601
diff --git a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsxindex e211f38fc..6f40165db 100644--- a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx+++ b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx@@ -1,7 +1,7 @@"use client";import { Button } from "@cap/ui";-import { useMutation } from "@tanstack/react-query";+import { useMutation, useQueryClient } from "@tanstack/react-query";import { useInvalidateTranscript, useTranscript } from "hooks/use-transcript";import {Check,@@ -135,6 +135,7 @@ const parseVTT = (vttContent: string): TranscriptEntry[] => {export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {const user = useCurrentUser();+ const queryClient = useQueryClient();const captionContext = useCaptionContext();const [transcriptData, setTranscriptData] = useState<TranscriptEntry[]>([]);const [selectedEntry, setSelectedEntry] = useState<number | null>(null);@@ -202,9 +203,9 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {onSuccess: () => {setRetryTriggered(true);invalidateTranscript(data.id);- },- onError: (error) => {- console.error("Failed to retry transcription:", error);+ queryClient.invalidateQueries({+ queryKey: ["videoStatus", data.id],+ });},});@@ -471,6 +472,30 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {<p className="mt-1 text-xs text-gray-9">This video doesn't contain audio for transcription</p>+ {canEdit && (+ <>+ <Button+ type="button"+ onClick={() => {+ retryTranscriptionMutation.mutate();+ }}+ disabled={retryTranscriptionMutation.isPending}+ variant="primary"+ size="sm"+ spinner={retryTranscriptionMutation.isPending}+ className="mt-4"+ >+ {retryTranscriptionMutation.isPending+ ? "Retrying..."+ : "Retry transcription"}+ </Button>+ {retryTranscriptionMutation.isError && (+ <p className="mt-2 text-xs text-red-500">+ Failed to retry. Please try again.+ </p>+ )}+ </>+ )}</div></div>);@@ -511,19 +536,26 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {: "No transcript available"}</p>{canEdit && (- <Button- onClick={() => {- retryTranscriptionMutation.mutate();- }}- disabled={retryTranscriptionMutation.isPending}- variant="primary"- size="sm"- spinner={retryTranscriptionMutation.isPending}- >- {retryTranscriptionMutation.isPending- ? "Retrying..."- : "Retry Transcription"}- </Button>+ <>+ <Button+ onClick={() => {+ retryTranscriptionMutation.mutate();+ }}+ disabled={retryTranscriptionMutation.isPending}+ variant="primary"+ size="sm"+ spinner={retryTranscriptionMutation.isPending}+ >+ {retryTranscriptionMutation.isPending+ ? "Retrying..."+ : "Retry Transcription"}+ </Button>+ {retryTranscriptionMutation.isError && (+ <p className="mt-2 text-xs text-red-500">+ Failed to retry. Please try again.+ </p>+ )}+ </>)}</div></div>diff --git a/apps/web/workflows/transcribe.ts b/apps/web/workflows/transcribe.tsindex 7e8b6cfab..617c72885 100644--- a/apps/web/workflows/transcribe.ts+++ b/apps/web/workflows/transcribe.ts@@ -218,7 +218,7 @@ async function extractAudio(.pipe(runPromise);const audioSignedUrl = await bucket- .getSignedObjectUrl(audioKey)+ .getInternalSignedObjectUrl(audioKey).pipe(runPromise);return audioSignedUrl;@@ -248,7 +248,7 @@ async function resolveVideoSourceUrl();for (const key of candidateKeys) {- const url = await bucket.getSignedObjectUrl(key).pipe(runPromise);+ const url = await bucket.getInternalSignedObjectUrl(key).pipe(runPromise);const response = await fetch(url, {method: "GET",headers: { range: "bytes=0-0" },diff --git a/packages/web-backend/src/S3Buckets/index.ts b/packages/web-backend/src/S3Buckets/index.tsindex 77666bca7..1a16c9729 100644--- a/packages/web-backend/src/S3Buckets/index.ts+++ b/packages/web-backend/src/S3Buckets/index.ts@@ -126,7 +126,6 @@ export class S3Buckets extends Effect.Service<S3Buckets>()("S3Buckets", {return Effect.succeed<typeof s3>({...s3,getSignedObjectUrl: getCloudFrontSignedUrl,- getInternalSignedObjectUrl: getCloudFrontSignedUrl,});}),),