fix: harden public download companion sync

This commit is contained in:
john
2026-07-01 11:10:58 +08:00
parent 6e4e0e2937
commit 6cb1a2475d
3 changed files with 160 additions and 32 deletions
+6 -1
View File
@@ -4276,7 +4276,7 @@ api.get('/sessions/:sessionId/events', async (req, res, next) => {
messages = null;
}
}
await syncPublicHtmlAfterFinish({
const syncResult = await syncPublicHtmlAfterFinish({
messages,
currentUser: req.currentUser,
publishDir,
@@ -4285,6 +4285,11 @@ api.get('/sessions/:sessionId/events', async (req, res, next) => {
? (userId, options) => mindSpaceAssets.syncWorkspaceAssets(userId, options)
: null,
});
if (Array.isArray(syncResult?.docxSync?.missing) && syncResult.docxSync.missing.length > 0) {
console.warn(
`[MindSpace] missing public download files after finish for user ${uid}: ${syncResult.docxSync.missing.join(', ')}`,
);
}
await syncUserGeneratedPages(uid);
};
return tkmindProxy.proxySessionEvents(req, res, sessionId, {