From d220cf76007f72f589f4affc235e84f84b080e4e Mon Sep 17 00:00:00 2001 From: Marco Salazar Date: Wed, 27 Sep 2023 13:08:14 -0400 Subject: [PATCH] normalize cache key --- .../ui-core/src/asset-graph/AssetGraphExplorer.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx index dcf8cd268535a..3cba934dde8cf 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/asset-graph/AssetGraphExplorer.tsx @@ -142,7 +142,7 @@ const AssetGraphExplorerWithData: React.FC = ({ assetGraphData, // Use the pathname as part of the key so that different deployments don't invalidate each other's cached layout // Remove the slash at the end in the key so that the same layout is used for both `/path` and `/path/` - `explorer:${pathname.endsWith('/') ? pathname.slice(0, pathname.length - 1) : pathname}`, + `explorer:${normalizePathnameForCacheKey(pathname)}`, fullAssetGraphData, ); const viewportEl = React.useRef(); @@ -585,3 +585,9 @@ const assetKeyTokensInRange = ( return uniq(ledToTarget); }; + +function normalizePathnameForCacheKey(pathname: string) { + const _path = pathname.endsWith('/') ? pathname.slice(0, pathname.length - 1) : pathname; + // Remove the op query string + return _path.split('~')[0]; +}