[web] disable filestore writes (#23470)

GitOrigin-RevId: 96ccd9205f9bf21420e67aaa68f8bc035eeb87d8
This commit is contained in:
Jakob Ackermann
2025-02-10 09:05:33 +00:00
committed by Copybot
parent 12494acdf7
commit b5f96b50c0
8 changed files with 302 additions and 176 deletions
@@ -213,8 +213,8 @@ async function _copyFiles(sourceEntries, sourceProject, targetProject) {
file.hash = sourceFile.hash
}
let createdBlob = false
const usingFilestore = Features.hasFeature('filestore')
if (file.hash != null && Features.hasFeature('project-history-blobs')) {
const usingFilestore = Features.hasFeature('filestore')
try {
await HistoryManager.promises.copyBlob(
sourceHistoryId,
@@ -250,6 +250,12 @@ async function _copyFiles(sourceEntries, sourceProject, targetProject) {
if (createdBlob && Features.hasFeature('project-history-blobs')) {
return { createdBlob, file, path, url: null }
}
if (!usingFilestore) {
// Note: This is also checked in app.mjs
throw new OError(
'bad config: need to enable either filestore or project-history-blobs'
)
}
const url = await FileStoreHandler.promises.copyFile(
sourceProject._id,
sourceFile._id,