Skip to content

Commit 23c2e8b

Browse files
committed
fix(snipsync): restrict target file scanning to .md/.mdx
snipsync.config.yaml never set features.allowed_target_extensions, which snipsync defaults to [] ("scan every file under targets/docs"). Its Sync.js reads every scanned file line-by-line as UTF-8 text and rewrites it the same way, which silently corrupts binary assets (PNG/SVG) with non-UTF-8 bytes on every daily sync run. Confirmed on PR #4908: a synced PNG grew from 1.1MB to 2.1MB and is no longer a valid image (each non-UTF-8 byte, e.g. PNG's 0x89 magic byte, was replaced with the 3-byte U+FFFD replacement character). Restricting the scan to .md/.mdx (the only content types docs/ snippets live in) avoids touching the 6 PNGs and 3 SVGs in docs/.
1 parent 2c2763f commit 23c2e8b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

snipsync.config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ targets:
4848
features:
4949
enable_source_link: true
5050
enable_code_block: true
51+
# Without this, snipsync scans every file under `targets` (docs/), including
52+
# binary assets. It reads/writes files line-by-line as UTF-8 text, which
53+
# corrupts any PNG/SVG in its path (invalid UTF-8 bytes become U+FFFD).
54+
# See: https://github.com/temporalio/documentation/pull/4908
55+
allowed_target_extensions: [.md, .mdx]

0 commit comments

Comments
 (0)