Repository navigation
Description
Description
When duplicating a page that contains image attachments with non-ASCII filenames (e.g., Korean characters like 스크린샷_2026-01-06.png), the attachment files fail to be physically copied to the new attachment path. The page itself is duplicated successfully, and the attachmentId in the document content is correctly replaced, but the actual file is missing — resulting in broken images (404).
Attachments with ASCII-only filenames (e.g., image.png) are copied successfully.
Steps to Reproduce
- Create a page with images that have non-ASCII filenames (e.g., paste a screenshot on macOS — it generates filenames like
스크린샷_2026-01-06.png) - Duplicate the page (same space or cross-space)
- Open the duplicated page — all images with non-ASCII filenames are broken
Expected Behavior
All attachments should be copied regardless of filename encoding.
Actual Behavior
- Attachments with ASCII filenames (
image.png) → copied successfully - Attachments with non-ASCII filenames (
스크린샷_...png,정보.png) → copy fails silently (404)
Verification
# Original attachment — 200 OK
curl -s -o /dev/null -w "%{http_code}" \
"https://{host}/api/files/019b9105-ce1a-726b-a09d-eb2fc65f904a/스크린샷_2026-01-06.png"
# → 200
# Duplicated attachment (new ID) — 404 Not Found
curl -s -o /dev/null -w "%{http_code}" \
"https://{host}/api/files/019cdf94-798b-7443-a667-b7f3016d8581/스크린샷_2026-01-06.png"
# → 404Server Logs
{"level":"error","context":"PageService","msg":"Duplicate page: failed to copy attachment 019b90ed-cf20-76cf-911e-db61d618ddad"}
{"level":"error","context":"PageService","msg":"Duplicate page: failed to copy attachment 019b90f0-4913-77ba-b06d-99832180e9c8"}
{"level":"error","context":"PageService","msg":"Duplicate page: failed to copy attachment 019b90f0-e7a7-706a-b9c9-0c3531c284f3"}
{"level":"error","context":"PageService","msg":"Duplicate page: failed to copy attachment 019b90f4-b3c5-76fd-aea8-18fb6fd331dc"}
{"level":"error","context":"PageService","msg":"Duplicate page: failed to copy attachment 019b9105-ce1a-726b-a09d-eb2fc65f904a"}Suspected Cause
In page.service.ts, the duplicatePage() method copies attachments via storageService.copy(). The source path is constructed using the original fileName which may contain non-ASCII characters. On Linux filesystems (especially within containers), the path encoding may not match, causing fs.copy() to fail with a file-not-found error. The error is caught and logged, but the duplication continues without the attachment — resulting in a broken image.
Activity
fix: handle non-ASCII filenames when duplicating page attachments
fix: copy attachments with non-ASCII filenames on page duplicate