From f3e10dea7fe2aca3ae1b29c977761d3815762297 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 27 Feb 2024 12:43:28 -0800 Subject: [PATCH] Oops, fix missing field in item search results Apollo cache! Oh right, `imageUrl` is the name of the field relative to what the app expects, but under the hood `useOutfitAppearance` actually makes that an alias for `imageUrlV2(idealSize: SIZE_600)`. So we need to cache it as the same field with the same params, rather than as just plain `imageUrl`! This fixes the bug where wearing an item from search would require a network round-trip and visually remove all items in the meantime. (Also, none of this issue was visible to most users, because item search is still feature-flagged onto the old GQL one for most people!) --- app/javascript/wardrobe-2020/loaders/items.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/wardrobe-2020/loaders/items.js b/app/javascript/wardrobe-2020/loaders/items.js index 8c23b4ef..1b3f5d1e 100644 --- a/app/javascript/wardrobe-2020/loaders/items.js +++ b/app/javascript/wardrobe-2020/loaders/items.js @@ -136,7 +136,7 @@ function writeItemToApolloCache(item, { speciesId, colorId, altStyleId }) { knownGlitches svgUrl canvasMovieLibraryUrl - imageUrl + imageUrl: imageUrlV2(idealSize: SIZE_600) swfUrl zone { id