Skip to content

Commit 265071c

Browse files
committed
fix(confluence): reuse pageToStub in getDocument to keep hashes in sync
Replace duplicated versionKey/contentHash logic with a single call to pageToStub so listDocuments and getDocument can never drift.
1 parent c877c31 commit 265071c

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

apps/sim/connectors/confluence/confluence.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -307,26 +307,16 @@ export const confluenceConnector: ConnectorConfig = {
307307
const labels = labelMap.get(String(page.id)) ?? []
308308

309309
const links = page._links as Record<string, unknown> | undefined
310-
const version = page.version as Record<string, unknown> | undefined
311-
const versionNumber = version?.number as number | undefined
312-
const lastModified = (version?.createdAt ?? version?.when ?? '') as string
313-
const versionKey = versionNumber ?? lastModified
310+
const stub = pageToStub(page, {
311+
spaceId: page.spaceId,
312+
labels,
313+
sourceUrl: links?.webui ? `https://${domain}/wiki${links.webui}` : undefined,
314+
})
314315

315316
return {
316-
externalId: String(page.id),
317-
title: (page.title as string) || 'Untitled',
317+
...stub,
318318
content: plainText,
319319
contentDeferred: false,
320-
mimeType: 'text/plain',
321-
sourceUrl: links?.webui ? `https://${domain}/wiki${links.webui}` : undefined,
322-
contentHash: `confluence:${page.id}:${versionKey}`,
323-
metadata: {
324-
spaceId: page.spaceId,
325-
status: page.status,
326-
version: versionNumber,
327-
labels,
328-
lastModified,
329-
},
330320
}
331321
},
332322

0 commit comments

Comments
 (0)