mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 09:07:46 +02:00
Switch cloud-upstream preview to manifest-only shape (PAP-9798)
Companies with thousands of issues serialize to >64 MiB when we ship every entity body to the cloud preview endpoint, so the wizard cannot leave the Connect step. The cloud now accepts a manifest-only preview shape (PAP-9797, cloud commit 41d3551); opt into it so the Preview push button works at PAP scale. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
1 parent
30265f4ef1
commit
15c8a8e6fd
1 file changed
+13
-1
@@ -253,9 +253,15 @@ export function cloudUpstreamService(db: Db, options: { instanceId?: string } =
|
||||
}
|
||||
|
||||
const bundle = await buildBundle(connection, "preview");
|
||||
const conflictKeysBySource: Record<string, string[]> = {};
|
||||
for (const entity of bundle.entities) {
|
||||
if (!entity.conflictKeys || entity.conflictKeys.length === 0) continue;
|
||||
conflictKeysBySource[sourceEntityKeyString(entity.record.key)] = [...entity.conflictKeys];
|
||||
}
|
||||
const remotePreview = await remotePost(connection, `/api/companies/${encodeURIComponent(connection.targetCompanyId)}/upstream-imports/preview`, {
|
||||
manifest: bundle.manifest,
|
||||
entities: bundle.entities,
|
||||
previewShape: "manifest_only",
|
||||
conflictKeysBySource,
|
||||
});
|
||||
return {
|
||||
...basePreview,
|
||||
@@ -1059,6 +1065,12 @@ function shortHash(value: string): string {
|
||||
return crypto.createHash("sha256").update(value).digest("hex").slice(0, 12);
|
||||
}
|
||||
|
||||
function sourceEntityKeyString(key: SourceEntityKey): string {
|
||||
return [key.sourceInstanceId, key.sourceCompanyId, key.sourceEntityType, key.sourceEntityId]
|
||||
.map((part) => encodeURIComponent(part))
|
||||
.join("/");
|
||||
}
|
||||
|
||||
function titleFromCode(code: string): string {
|
||||
return code
|
||||
.replace(/_/g, " ")
|
||||
|
||||
Reference in new issue
Block a user