Skip to content

Commit 0980add

Browse files
committed
fix(confluence): invalidate existing doc hashes on representation change
The version-based contentHash meant already-synced mirrored documents (with stale empty content) classified as 'unchanged' and never re-hydrated with the new rendered view content. Embed a body-representation marker in the hash so a representation change invalidates every previously-synced Confluence document, forcing a one-time re-hydration that picks up the expanded include/excerpt text.
1 parent 9261c4a commit 0980add

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

apps/sim/connectors/confluence/confluence.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ async function fetchLabelsForPages(
9191
return labelsByPageId
9292
}
9393

94+
/**
95+
* Body representation marker embedded in the contentHash. Bumping this
96+
* invalidates every previously-synced Confluence document so a one-time
97+
* re-hydration picks up content newly reachable by the current extraction
98+
* (e.g. the switch from `storage` to rendered `view`, which expands Include
99+
* Page / Excerpt macros). Without it, already-indexed pages whose version is
100+
* unchanged classify as `unchanged` and keep their stale (empty) content.
101+
*/
102+
const CONTENT_REPRESENTATION = 'view'
103+
94104
/**
95105
* Produces a canonical metadata stub with a deterministic contentHash that
96106
* does not depend on which API surface (v1 CQL or v2) returned the page.
@@ -115,7 +125,7 @@ function pageToStub(
115125
contentDeferred: true,
116126
mimeType: 'text/plain',
117127
sourceUrl: options.sourceUrl,
118-
contentHash: `confluence:${page.id}:${versionKey}`,
128+
contentHash: `confluence:${CONTENT_REPRESENTATION}:${page.id}:${versionKey}`,
119129
metadata: {
120130
spaceId: options.spaceId,
121131
status: page.status,

0 commit comments

Comments
 (0)