Skip to content

fix(worker): normalize encoded document filenames - #386

Merged
suguanYang merged 1 commit into
mainfrom
fix/wangbinqi/decode-upload-filenames
Sep 7, 2026
Merged

fix(worker): normalize encoded document filenames#386
suguanYang merged 1 commit into
mainfrom
fix/wangbinqi/decode-upload-filenames

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • decode percent-encoded URL basenames before storing URL-ingestion source filenames
  • defensively decode legacy encoded filenames at the worker filesystem boundary
  • add regression coverage for the production Chinese .doc filename pattern

Production evidence

This fixes the failure in Logfire trace 01a0770227cb4797dc15fe52b0b3ab15 (job_53f9d9d7b6d7). LibreOffice returned exit code 0 but wrote the .docx under the decoded Chinese output directory, while the worker checked for an encoded expected path. The same document succeeded in production when its decoded filename was used.

Verification

  • uv run --project apps/worker pytest apps/worker/tests/unit/test_internal_parse_name.py -q — 2 passed
  • uv run --project apps/api pytest apps/api/tests/unit/test_document_ingestion_filename.py -q — 1 passed
  • focused Ruff checks — passed
  • git diff --check — passed

The full worker unit suite was not runnable locally because required environment settings are absent (S3_BUCKET_NAME, S3_TEMP_PATH, DATABASE_URL, TMP_PATH).

@suguanYang
suguanYang merged commit 56f48b8 into main Sep 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant