Skip to content

Commit 684762c

Browse files
fix: Ensure vNode synchronization between buildImage and buildParagraph
- buildImage now updates vNode.properties.src with cached/converted data URLs - Eliminates dual processing of the same image through different code paths - Prevents buildParagraph from reprocessing already-cached images - Resolves "unsupported file type: undefined" errors completely - All image processing paths now see consistent, processed data URLs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5dbfd81 commit 684762c

File tree

3 files changed

+4
-80
lines changed

3 files changed

+4
-80
lines changed

debug-test.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/helpers/render-document-file.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ export const buildImage = async (docxDocumentInstance, vNode, maximumWidth = nul
8787
}
8888
logVerbose(verboseLogging, `[CACHE] Using cached image data for: ${imageSource}`);
8989
base64Uri = cachedData;
90+
// Update vNode to reflect the cached data URL for subsequent processing
91+
vNode.properties.src = base64Uri;
9092
} else if (isValidUrl(imageSource)) {
9193
// Download and cache the image with retry mechanism
9294
let base64String = null;
@@ -130,6 +132,8 @@ export const buildImage = async (docxDocumentInstance, vNode, maximumWidth = nul
130132
// Cache the successful result
131133
imageCache.set(imageSource, base64Uri);
132134
logVerbose(verboseLogging, `[CACHE] Cached new image data for: ${imageSource}`);
135+
// Update vNode to reflect the new data URL for subsequent processing
136+
vNode.properties.src = base64Uri;
133137
} else {
134138
// Cache the failure for THIS document generation only after all retries failed
135139
// Note: Cache is cleared between document generations, so failures can be retried in future runs

test-config.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)