From 29571c0da3b3a588b57125e5dc56eaa78639c1b7 Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Mon, 16 Mar 2026 16:19:15 +0000 Subject: Change image extension priority Sometimes, WebP icons won't load despite extensions.json clearly defining it as the only extension used for all image data. I suspect there's a race condition between fetching extensions.json, parsing it into client, and checking what extension we should use to get character icons during loading. Sometimes it correctly loads images, sometimes it falls back and starts requesting PNG instead. I couldn't precisely identify where it happens and what's the root cause. As a workaround, this commit instead makes WebP the first-priority extension and a fallback. --- webAO/client/fetchLists.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'webAO/client/fetchLists.ts') diff --git a/webAO/client/fetchLists.ts b/webAO/client/fetchLists.ts index 2f2fd59..4e32abc 100644 --- a/webAO/client/fetchLists.ts +++ b/webAO/client/fetchLists.ts @@ -62,10 +62,10 @@ export const fetchExtensions = async () => { try { const extensiondata = await request(`${AO_HOST}extensions.json`); const allextensions = JSON.parse(extensiondata); - client.charicon_extensions = allextensions.charicon_extensions || [".png", ".webp"]; - client.emote_extensions = allextensions.emote_extensions || [".gif", ".png", ".apng", ".webp", ".webp.static"]; - client.emotions_extensions = allextensions.emotions_extensions || [".png", ".webp"]; - client.background_extensions = allextensions.background_extensions || [".png", ".gif", ".webp", ".apng"]; + client.charicon_extensions = allextensions.charicon_extensions || [".webp", ".png"]; + client.emote_extensions = allextensions.emote_extensions || [".webp", ".png", ".apng", ".gif"]; + client.emotions_extensions = allextensions.emotions_extensions || [".webp", ".png"]; + client.background_extensions = allextensions.background_extensions || [".webp", ".png", ".apng", ".gif"]; console.log("charicons "+client.charicon_extensions) console.log("emotes "+client.emote_extensions) console.log("emotions "+client.emotions_extensions) -- cgit