From 943f9ea9c1567f52348af3dca40c3b60bd22be1a Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:19:11 +0530 Subject: [PATCH 01/14] Wait for pairing code before initializing cast --- web/apps/cast/src/pages/index.tsx | 14 ++++++++------ web/apps/cast/src/services/pair.ts | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web/apps/cast/src/pages/index.tsx b/web/apps/cast/src/pages/index.tsx index bc0f6253db..98dabd97e8 100644 --- a/web/apps/cast/src/pages/index.tsx +++ b/web/apps/cast/src/pages/index.tsx @@ -27,10 +27,12 @@ export default function Index() { }; useEffect(() => { - castReceiverLoadingIfNeeded().then((cast) => - advertiseCode(cast, () => pairingCode), - ); - }, []); + if (pairingCode) { + castReceiverLoadingIfNeeded().then((cast) => + advertiseCode(cast, () => pairingCode), + ); + } + }, [pairingCode]); useEffect(() => { if (!publicKeyB64 || !privateKeyB64 || !pairingCode) return; @@ -54,8 +56,8 @@ export default function Index() { } catch (e) { log.error("Failed to get cast data", e); // Start again from the beginning. - setPairingCode(undefined); - init(); + // setPairingCode(undefined); + // init(); } }; diff --git a/web/apps/cast/src/services/pair.ts b/web/apps/cast/src/services/pair.ts index 66f9feddd1..987dfd5c91 100644 --- a/web/apps/cast/src/services/pair.ts +++ b/web/apps/cast/src/services/pair.ts @@ -116,8 +116,9 @@ export const advertiseCode = ( const namespace = "urn:x-cast:pair-request"; const options = new cast.framework.CastReceiverOptions(); + options.skipPlayersLoad = true; // Do not automatically close the connection when the sender disconnects. - options.maxInactivity = 3600; /* 1 hour */ + // options.maxInactivity = 3600; /* 1 hour */ // TODO:Is this required? The docs say "(The default type of a message bus // is JSON; if not provided here)." options.customNamespaces = Object.assign({}); From b917237db23258d9195468c46c27774b70f49118 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:23:24 +0530 Subject: [PATCH 02/14] Code can become invalid after timeout --- web/apps/cast/src/pages/index.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/web/apps/cast/src/pages/index.tsx b/web/apps/cast/src/pages/index.tsx index 98dabd97e8..5cf3f8f3a7 100644 --- a/web/apps/cast/src/pages/index.tsx +++ b/web/apps/cast/src/pages/index.tsx @@ -11,6 +11,9 @@ export default function Index() { const [publicKeyB64, setPublicKeyB64] = useState(); const [privateKeyB64, setPrivateKeyB64] = useState(); const [pairingCode, setPairingCode] = useState(); + // TODO: This needs to change, since there is an interim period when the + // code becomes invalid. + const [haveInitializedCast, setHaveInitializedCast] = useState(false); const router = useRouter(); @@ -27,10 +30,11 @@ export default function Index() { }; useEffect(() => { - if (pairingCode) { - castReceiverLoadingIfNeeded().then((cast) => - advertiseCode(cast, () => pairingCode), - ); + if (pairingCode && !haveInitializedCast) { + castReceiverLoadingIfNeeded().then((cast) => { + setHaveInitializedCast(true); + advertiseCode(cast, () => pairingCode); + }); } }, [pairingCode]); @@ -54,10 +58,11 @@ export default function Index() { storeCastData(data); await router.push("/slideshow"); } catch (e) { + // Code has become invalid log.error("Failed to get cast data", e); // Start again from the beginning. - // setPairingCode(undefined); - // init(); + setPairingCode(undefined); + init(); } }; From c9601c33c39566eedcafdcbdbf73aad988d0b734 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:38:30 +0530 Subject: [PATCH 03/14] Debug --- web/apps/cast/src/pages/slideshow.tsx | 2 ++ web/apps/cast/src/services/pair.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/apps/cast/src/pages/slideshow.tsx b/web/apps/cast/src/pages/slideshow.tsx index bd3339b42b..75ef0827f0 100644 --- a/web/apps/cast/src/pages/slideshow.tsx +++ b/web/apps/cast/src/pages/slideshow.tsx @@ -46,6 +46,8 @@ export default function Slideshow() { }; }, []); + log.info("Rendering slideshow", { loading, imageURL, nextImageURL }); + if (loading) return ; return ; diff --git a/web/apps/cast/src/services/pair.ts b/web/apps/cast/src/services/pair.ts index 987dfd5c91..db8c266a47 100644 --- a/web/apps/cast/src/services/pair.ts +++ b/web/apps/cast/src/services/pair.ts @@ -116,9 +116,9 @@ export const advertiseCode = ( const namespace = "urn:x-cast:pair-request"; const options = new cast.framework.CastReceiverOptions(); - options.skipPlayersLoad = true; + // options.skipPlayersLoad = true; // Do not automatically close the connection when the sender disconnects. - // options.maxInactivity = 3600; /* 1 hour */ + options.maxInactivity = 3600; /* 1 hour */ // TODO:Is this required? The docs say "(The default type of a message bus // is JSON; if not provided here)." options.customNamespaces = Object.assign({}); From 2f87c3cf5a36cfcd09070ad7b50d7607c5d5b517 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:50:03 +0530 Subject: [PATCH 04/14] Debug 2 --- web/apps/cast/src/pages/slideshow.tsx | 2 +- web/apps/cast/src/services/cast.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/web/apps/cast/src/pages/slideshow.tsx b/web/apps/cast/src/pages/slideshow.tsx index 75ef0827f0..98426a8579 100644 --- a/web/apps/cast/src/pages/slideshow.tsx +++ b/web/apps/cast/src/pages/slideshow.tsx @@ -46,7 +46,7 @@ export default function Slideshow() { }; }, []); - log.info("Rendering slideshow", { loading, imageURL, nextImageURL }); + console.log("Rendering slideshow", { loading, imageURL, nextImageURL }); if (loading) return ; diff --git a/web/apps/cast/src/services/cast.ts b/web/apps/cast/src/services/cast.ts index 8ead8962ab..75ab743f38 100644 --- a/web/apps/cast/src/services/cast.ts +++ b/web/apps/cast/src/services/cast.ts @@ -7,7 +7,7 @@ import { shuffled } from "@/utils/array"; import { ensure, ensureString } from "@/utils/ensure"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import HTTPService from "@ente/shared/network/HTTPService"; -import { getCastFileURL, getEndpoint } from "@ente/shared/network/api"; +import { getCastFileURL, getCastThumbnailURL, getEndpoint } from "@ente/shared/network/api"; import { wait } from "@ente/shared/utils"; import { detectMediaMIMEType } from "services/detect-type"; import { @@ -140,7 +140,8 @@ export const renderableImageURLs = async function* (castData: CastData) { if (urls.length < 4) continue; const oldestURL = urls.shift(); - if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL); + console.log("Not revoking", oldestURL); + // if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL); i += 1; const urlPair: RenderableImageURLPair = [ @@ -298,7 +299,7 @@ const downloadFile = async (castToken: string, file: EnteFile) => { if (!isImageOrLivePhoto(file)) throw new Error("Can only cast images and live photos"); - const url = getCastFileURL(file.id); + const url = getCastThumbnailURL(file.id); const resp = await HTTPService.get( url, null, @@ -312,7 +313,7 @@ const downloadFile = async (castToken: string, file: EnteFile) => { const cryptoWorker = await ComlinkCryptoWorker.getInstance(); const decrypted = await cryptoWorker.decryptFile( new Uint8Array(resp.data), - await cryptoWorker.fromB64(file.file.decryptionHeader), + await cryptoWorker.fromB64(file.thumbnail.decryptionHeader), file.key, ); return new Response(decrypted).blob(); From 3b7dbe6628d4ea1bf1c0f949da8faa3d93e14e6d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:51:48 +0530 Subject: [PATCH 05/14] Fix --- web/apps/cast/src/services/cast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/apps/cast/src/services/cast.ts b/web/apps/cast/src/services/cast.ts index 75ab743f38..f1cb8ca371 100644 --- a/web/apps/cast/src/services/cast.ts +++ b/web/apps/cast/src/services/cast.ts @@ -7,7 +7,7 @@ import { shuffled } from "@/utils/array"; import { ensure, ensureString } from "@/utils/ensure"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import HTTPService from "@ente/shared/network/HTTPService"; -import { getCastFileURL, getCastThumbnailURL, getEndpoint } from "@ente/shared/network/api"; +import { getCastThumbnailURL, getEndpoint } from "@ente/shared/network/api"; import { wait } from "@ente/shared/utils"; import { detectMediaMIMEType } from "services/detect-type"; import { From 7658b997421f336406aeda13d7d153ff747a128c Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:54:16 +0530 Subject: [PATCH 06/14] Fix --- web/apps/cast/src/services/cast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/apps/cast/src/services/cast.ts b/web/apps/cast/src/services/cast.ts index f1cb8ca371..71b0cb53ff 100644 --- a/web/apps/cast/src/services/cast.ts +++ b/web/apps/cast/src/services/cast.ts @@ -142,7 +142,7 @@ export const renderableImageURLs = async function* (castData: CastData) { const oldestURL = urls.shift(); console.log("Not revoking", oldestURL); // if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL); - i += 1; + // i += 1; const urlPair: RenderableImageURLPair = [ ensure(urls[0]), From b7734406b87870eb0420eaddbc69d26f942fb02b Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 May 2024 11:57:47 +0530 Subject: [PATCH 07/14] Fix --- web/apps/cast/src/services/cast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/apps/cast/src/services/cast.ts b/web/apps/cast/src/services/cast.ts index 71b0cb53ff..6abb1a6ad9 100644 --- a/web/apps/cast/src/services/cast.ts +++ b/web/apps/cast/src/services/cast.ts @@ -98,7 +98,7 @@ export const renderableImageURLs = async function* (castData: CastData) { * memory leak of the very first objectURL that we display. */ const urls: string[] = [""]; - let i = 0; + // const i = 0; /** * Number of milliseconds to keep the slide on the screen. From 816f8cecd646e0f9fb2ba9013d473741baebbf93 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 13:24:06 +0530 Subject: [PATCH 08/14] Rearrange --- web/apps/cast/src/pages/index.tsx | 42 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/web/apps/cast/src/pages/index.tsx b/web/apps/cast/src/pages/index.tsx index 5cf3f8f3a7..175d75bbcd 100644 --- a/web/apps/cast/src/pages/index.tsx +++ b/web/apps/cast/src/pages/index.tsx @@ -11,30 +11,27 @@ export default function Index() { const [publicKeyB64, setPublicKeyB64] = useState(); const [privateKeyB64, setPrivateKeyB64] = useState(); const [pairingCode, setPairingCode] = useState(); - // TODO: This needs to change, since there is an interim period when the - // code becomes invalid. + + // Keep a boolean flag to ensure that Cast Receiver starts only once even if + // pairing codes change. const [haveInitializedCast, setHaveInitializedCast] = useState(false); const router = useRouter(); useEffect(() => { - init(); - }, []); - - const init = () => { - register().then((r) => { - setPublicKeyB64(r.publicKeyB64); - setPrivateKeyB64(r.privateKeyB64); - setPairingCode(r.pairingCode); - }); - }; - - useEffect(() => { - if (pairingCode && !haveInitializedCast) { - castReceiverLoadingIfNeeded().then((cast) => { - setHaveInitializedCast(true); - advertiseCode(cast, () => pairingCode); + if (!pairingCode) { + register().then((r) => { + setPublicKeyB64(r.publicKeyB64); + setPrivateKeyB64(r.privateKeyB64); + setPairingCode(r.pairingCode); }); + } else { + if (!haveInitializedCast) { + castReceiverLoadingIfNeeded().then((cast) => { + setHaveInitializedCast(true); + advertiseCode(cast, () => pairingCode); + }); + } } }, [pairingCode]); @@ -58,11 +55,12 @@ export default function Index() { storeCastData(data); await router.push("/slideshow"); } catch (e) { - // Code has become invalid - log.error("Failed to get cast data", e); - // Start again from the beginning. + // The pairing code becomes invalid after an hour, which will cause + // `getCastData` to fail. There might be other reasons this might + // fail too, but in all such cases, it is a reasonable idea to start + // again from the beginning. + log.warn("Failed to get cast data", e); setPairingCode(undefined); - init(); } }; From ddb19e2333ae801322a3969534e4bdce330cfdc0 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 13:57:59 +0530 Subject: [PATCH 09/14] Restart on collection ID mismatches --- web/apps/cast/src/services/pair.ts | 67 +++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 11 deletions(-) diff --git a/web/apps/cast/src/services/pair.ts b/web/apps/cast/src/services/pair.ts index db8c266a47..ddaaba7e03 100644 --- a/web/apps/cast/src/services/pair.ts +++ b/web/apps/cast/src/services/pair.ts @@ -116,25 +116,68 @@ export const advertiseCode = ( const namespace = "urn:x-cast:pair-request"; const options = new cast.framework.CastReceiverOptions(); - // options.skipPlayersLoad = true; - // Do not automatically close the connection when the sender disconnects. - options.maxInactivity = 3600; /* 1 hour */ + // We don't use the media features of the Cast SDK. + options.skipPlayersLoad = true; // TODO:Is this required? The docs say "(The default type of a message bus // is JSON; if not provided here)." options.customNamespaces = Object.assign({}); options.customNamespaces[namespace] = cast.framework.system.MessageType.JSON; - // TODO: This looks like the only one needed, but a comment with the reason - // might be good. + // Do not stop the casting if the receiver is unreachable. A user should be + // able to start a cast on their phone and then put it away, leaving the + // cast running on their big screen. options.disableIdleTimeout = true; + // The collection ID with which we paired. If we get another connection + // request for a different collection ID, restart the app to allow them to + // reconnect using a freshly generated pairing code. + // + // If the request does not have a collectionID, just keep a boolean flag. + let pairedCollectionID: string | boolean | undefined; + + type ListenerProps = { + senderId: string; + data: unknown; + }; + // Reply with the code that we have if anyone asks over Chromecast. - const incomingMessageListener = ({ senderId }: { senderId: string }) => { + const incomingMessageListener = ({ senderId, data }: ListenerProps) => { + const restart = (reason: string) => { + log.error(`Restarting app because ${reason}`); + // context.stop will close the tab but it'll get reopened again + // immediately since the client app will reconnect in the scenarios + // where we're calling this function. + context.stop(); + }; + + const cid = + data && + typeof data == "object" && + typeof data["collectionID"] == "string" + ? data["collectionID"] + : undefined; + + if (pairedCollectionID !== undefined && pairedCollectionID != cid) { + restart(`incoming request for a new collection ${cid}`); + return; + } + + pairedCollectionID = cid ?? true; + const code = pairingCode(); if (!code) { - log.warn( - "Ignoring incoming Chromecast message because we do not yet have a pairing code", - ); + // Our caller waits until it has a pairing code before it calls + // `advertiseCode`, but there is still an edge case where we can + // find ourselves without a pairing code: + // + // 1. The current pairing code expires. We start the process to get + // a new one. + // + // 2. But before that happens, someone connects. + // + // The window where this can happen is short, so if we do find + // ourselves in this scenario, + restart("we got a pairing request when refreshing pairing codes"); return; } @@ -148,8 +191,10 @@ export const advertiseCode = ( incomingMessageListener as unknown as SystemEventHandler, ); - // Shutdown ourselves if the sender disconnects. - // TODO(MR): I assume the page reloads on shutdown. Is that correct? + // Close the (chromecast) tab if the sender disconnects. + // + // Chromecast does a "shutdown" of our cast app when we call `context.stop`. + // This translates into it closing the tab where it is showing our app. context.addEventListener( cast.framework.system.EventType.SENDER_DISCONNECTED, () => context.stop(), From 22e33737e8f95fce611627ba9ccc6a3ba0e9e58c Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 14:02:23 +0530 Subject: [PATCH 10/14] Forego checks if client doesn't follow the protocol --- web/apps/cast/src/services/pair.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/apps/cast/src/services/pair.ts b/web/apps/cast/src/services/pair.ts index ddaaba7e03..0364cf4916 100644 --- a/web/apps/cast/src/services/pair.ts +++ b/web/apps/cast/src/services/pair.ts @@ -132,8 +132,8 @@ export const advertiseCode = ( // request for a different collection ID, restart the app to allow them to // reconnect using a freshly generated pairing code. // - // If the request does not have a collectionID, just keep a boolean flag. - let pairedCollectionID: string | boolean | undefined; + // If the request does not have a collectionID, forego this check. + let pairedCollectionID: string | undefined; type ListenerProps = { senderId: string; @@ -150,19 +150,19 @@ export const advertiseCode = ( context.stop(); }; - const cid = + const collectionID = data && typeof data == "object" && typeof data["collectionID"] == "string" ? data["collectionID"] : undefined; - if (pairedCollectionID !== undefined && pairedCollectionID != cid) { - restart(`incoming request for a new collection ${cid}`); + if (pairedCollectionID && pairedCollectionID != collectionID) { + restart(`incoming request for a new collection ${collectionID}`); return; } - pairedCollectionID = cid ?? true; + pairedCollectionID = collectionID; const code = pairingCode(); if (!code) { From 93444d3a490b0849f5063beadab60e133e65af1d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 14:04:39 +0530 Subject: [PATCH 11/14] Back to normal files --- web/apps/cast/src/services/cast.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/apps/cast/src/services/cast.ts b/web/apps/cast/src/services/cast.ts index 6abb1a6ad9..f975482604 100644 --- a/web/apps/cast/src/services/cast.ts +++ b/web/apps/cast/src/services/cast.ts @@ -7,7 +7,7 @@ import { shuffled } from "@/utils/array"; import { ensure, ensureString } from "@/utils/ensure"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import HTTPService from "@ente/shared/network/HTTPService"; -import { getCastThumbnailURL, getEndpoint } from "@ente/shared/network/api"; +import { getCastFileURL, getEndpoint } from "@ente/shared/network/api"; import { wait } from "@ente/shared/utils"; import { detectMediaMIMEType } from "services/detect-type"; import { @@ -299,7 +299,9 @@ const downloadFile = async (castToken: string, file: EnteFile) => { if (!isImageOrLivePhoto(file)) throw new Error("Can only cast images and live photos"); - const url = getCastThumbnailURL(file.id); + const url = getCastFileURL(file.id); + // TODO(MR): Remove if usused eventually + // const url = getCastThumbnailURL(file.id); const resp = await HTTPService.get( url, null, @@ -313,7 +315,9 @@ const downloadFile = async (castToken: string, file: EnteFile) => { const cryptoWorker = await ComlinkCryptoWorker.getInstance(); const decrypted = await cryptoWorker.decryptFile( new Uint8Array(resp.data), - await cryptoWorker.fromB64(file.thumbnail.decryptionHeader), + await cryptoWorker.fromB64(file.file.decryptionHeader), + // TODO(MR): Remove if usused eventually + // await cryptoWorker.fromB64(file.thumbnail.decryptionHeader), file.key, ); return new Response(decrypted).blob(); From d7a4e728dada9e64e60e2b9448b409a5a83a43f1 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 14:58:16 +0530 Subject: [PATCH 12/14] Completely on demand in an attempt to work on the lowmem Chromecast device --- web/apps/cast/src/components/Slide.tsx | 6 ++-- web/apps/cast/src/services/cast.ts | 42 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/web/apps/cast/src/components/Slide.tsx b/web/apps/cast/src/components/Slide.tsx index 8309f8bc2c..4df36c4c1d 100644 --- a/web/apps/cast/src/components/Slide.tsx +++ b/web/apps/cast/src/components/Slide.tsx @@ -11,7 +11,7 @@ interface SlideViewProps { * Also show {@link nextURL} in an hidden image view to prepare the browser for * an imminent transition to it. */ -export const SlideView: React.FC = ({ url, nextURL }) => { +export const SlideView: React.FC = ({ url }) => { return (
= ({ url, nextURL }) => { backdropFilter: "blur(10px)", }} > - + /> */} 1) + URL.revokeObjectURL(previousURLs.shift()); - const oldestURL = urls.shift(); - console.log("Not revoking", oldestURL); + previousURLs.push(url); + + // const previousURL = oldURLs.length == 0 ? undefined : urls.shift(); + + // if (urls.length < 2) continue; + + // console.log("Not revoking", oldestURL); // if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL); // i += 1; const urlPair: RenderableImageURLPair = [ - ensure(urls[0]), - ensure(urls[1]), + url, + "", + // ensure(urls[0]), + // ensure(urls[1]), ]; const elapsedTime = Date.now() - lastYieldTime; From 9d7c23d1c5a50566350966a55532f35d47ca7cdf Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 15:20:29 +0530 Subject: [PATCH 13/14] Restore the preload to see if looks less abrupt --- web/apps/cast/src/components/Slide.tsx | 6 ++-- web/apps/cast/src/services/cast.ts | 49 +++++++++++++++----------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/web/apps/cast/src/components/Slide.tsx b/web/apps/cast/src/components/Slide.tsx index 4df36c4c1d..8309f8bc2c 100644 --- a/web/apps/cast/src/components/Slide.tsx +++ b/web/apps/cast/src/components/Slide.tsx @@ -11,7 +11,7 @@ interface SlideViewProps { * Also show {@link nextURL} in an hidden image view to prepare the browser for * an imminent transition to it. */ -export const SlideView: React.FC = ({ url }) => { +export const SlideView: React.FC = ({ url, nextURL }) => { return (
= ({ url }) => { backdropFilter: "blur(10px)", }} > - {/* */} + /> 1) URL.revokeObjectURL(previousURLs.shift()); + // The URL that'll now get displayed on screen. + const url = ensure(urls.shift()); + // The URL that we're preloading for next time around. + const nextURL = ensure(urls[0]); + previousURLs.push(url); - // const previousURL = oldURLs.length == 0 ? undefined : urls.shift(); - - // if (urls.length < 2) continue; - - // console.log("Not revoking", oldestURL); - // if (oldestURL && i !== 1) URL.revokeObjectURL(oldestURL); - // i += 1; - - const urlPair: RenderableImageURLPair = [ - url, - "", - // ensure(urls[0]), - // ensure(urls[1]), - ]; + const urlPair: RenderableImageURLPair = [url, nextURL]; const elapsedTime = Date.now() - lastYieldTime; if (elapsedTime > 0 && elapsedTime < slideDuration) From afa9c35c0b0d7a289c0b532bf634e2ed6bb889a1 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 8 May 2024 15:27:59 +0530 Subject: [PATCH 14/14] Also ignore deploy-f's --- .github/workflows/auth-lint.yml | 2 +- .github/workflows/desktop-lint.yml | 2 +- .github/workflows/docs-verify-build.yml | 2 +- .github/workflows/mobile-lint.yml | 2 +- .github/workflows/server-lint.yml | 2 +- .github/workflows/web-lint.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auth-lint.yml b/.github/workflows/auth-lint.yml index 6504e0646a..63d644c2e3 100644 --- a/.github/workflows/auth-lint.yml +++ b/.github/workflows/auth-lint.yml @@ -3,7 +3,7 @@ name: "Lint (auth)" on: # Run on every push to a branch other than main that changes auth/ push: - branches-ignore: [main, "deploy/**"] + branches-ignore: [main, "deploy/**", "deploy-f/**"] paths: - "auth/**" - ".github/workflows/auth-lint.yml" diff --git a/.github/workflows/desktop-lint.yml b/.github/workflows/desktop-lint.yml index 0b8263f3d3..0c1929e6ac 100644 --- a/.github/workflows/desktop-lint.yml +++ b/.github/workflows/desktop-lint.yml @@ -3,7 +3,7 @@ name: "Lint (desktop)" on: # Run on every push to a branch other than main that changes desktop/ push: - branches-ignore: [main, "deploy/**"] + branches-ignore: [main, "deploy/**", "deploy-f/**"] paths: - "desktop/**" - ".github/workflows/desktop-lint.yml" diff --git a/.github/workflows/docs-verify-build.yml b/.github/workflows/docs-verify-build.yml index a57f71c868..5d31ff8378 100644 --- a/.github/workflows/docs-verify-build.yml +++ b/.github/workflows/docs-verify-build.yml @@ -6,7 +6,7 @@ name: "Verify build (docs)" on: # Run on every push to a branch other than main that changes docs/ push: - branches-ignore: [main, "deploy/**"] + branches-ignore: [main, "deploy/**", "deploy-f/**"] paths: - "docs/**" - ".github/workflows/docs-verify-build.yml" diff --git a/.github/workflows/mobile-lint.yml b/.github/workflows/mobile-lint.yml index 57b2ca4dbd..8abc6f0c73 100644 --- a/.github/workflows/mobile-lint.yml +++ b/.github/workflows/mobile-lint.yml @@ -3,7 +3,7 @@ name: "Lint (mobile)" on: # Run on every push to a branch other than main that changes mobile/ push: - branches-ignore: [main, f-droid, "deploy/**"] + branches-ignore: [main, f-droid, "deploy/**", "deploy-f/**"] paths: - "mobile/**" - ".github/workflows/mobile-lint.yml" diff --git a/.github/workflows/server-lint.yml b/.github/workflows/server-lint.yml index d25f2adcc8..30038b3b9f 100644 --- a/.github/workflows/server-lint.yml +++ b/.github/workflows/server-lint.yml @@ -3,7 +3,7 @@ name: "Lint (server)" on: # Run on every push to a branch other than main that changes server/ push: - branches-ignore: [main, "deploy/**"] + branches-ignore: [main, "deploy/**", "deploy-f/**"] paths: - "server/**" - ".github/workflows/server-lint.yml" diff --git a/.github/workflows/web-lint.yml b/.github/workflows/web-lint.yml index 0dc11aa0e7..baf2a98ab0 100644 --- a/.github/workflows/web-lint.yml +++ b/.github/workflows/web-lint.yml @@ -3,7 +3,7 @@ name: "Lint (web)" on: # Run on every push to a branch other than main that changes web/ push: - branches-ignore: [main, "deploy/**"] + branches-ignore: [main, "deploy/**", "deploy-f/**"] paths: - "web/**" - ".github/workflows/web-lint.yml"