[web] fix preparing clsi-cache when cloning project (#31169)

* [web] fix preparing clsi-cache when cloning project

* [monorepo] fix downloads from non-sharded clsi-cache

* [web] gracefully handle missing imageName when creating template

GitOrigin-RevId: 8647d1bb95edbedcd43cb6f9d9bc475f56e402c8
This commit is contained in:
Jakob Ackermann
2026-02-02 09:06:08 +00:00
committed by Copybot
parent 9bd7171413
commit 774d8434d8
2 changed files with 2 additions and 2 deletions
@@ -241,7 +241,6 @@ async function prepareCacheSource(
userId,
{ sourceProjectId, templateVersionId, imageName, lastUpdated, shard, signal }
) {
imageName = Path.basename(imageName)
const url = new URL(
`/project/${projectId}/user/${userId}/import-from`,
Settings.apis.clsiCache.instances.find(i => i.shard === shard).url
@@ -15,6 +15,7 @@ import crypto from 'node:crypto'
import Errors from '../Errors/Errors.js'
import { pipeline } from 'node:stream/promises'
import ClsiCacheManager from '../Compile/ClsiCacheManager.mjs'
import Path from 'node:path'
const { promises: ProjectRootDocManager } = ProjectRootDocManagerModule
const { promises: ProjectOptionsHandler } = ProjectOptionsHandlerModule
@@ -76,7 +77,7 @@ const TemplatesManager = {
const prepareClsiCacheInBackground = ClsiCacheManager.prepareClsiCache(
project._id,
userId,
{ templateVersionId, imageName }
{ templateVersionId, imageName: imageName && Path.basename(imageName) }
).catch(err => {
logger.warn(
{ err, templateVersionId, projectId: project._id },