Skip to content

fix(worker): prevent long internal parser filenames - #357

Merged
suguanYang merged 1 commit into
mainfrom
fix/wangbinqi/internal-filename-length-main
Aug 31, 2026
Merged

suguanYang merged 1 commit into
mainfrom
fix/wangbinqi/internal-filename-length-main

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary\n\n- cap internal parser basenames at 240 bytes before moving downloaded files\n- preserve the extension and append a deterministic hash when truncating\n- add a regression test for URL-encoded long filenames\n\n## Incident\n\nProduction trace 01a056b7ab03e18328f0d935beff61c3 failed job job_9acad6bd015f with OSError: [Errno 36] File name too long while renaming a temporary PDF. The source filename was URL-encoded Chinese text and exceeded Linux's per-component filename limit.\n\n## Verification\n\n- uv run ruff check on the touched files\n- uv run --project apps/worker pytest apps/worker/tests/unit/test_internal_parse_name.py -q\n- uv run pyright on the touched files\n\nAll focused checks pass.

Comment thread apps/worker/tests/unit/test_internal_parse_name.py Fixed
Comment thread apps/worker/tests/unit/test_internal_parse_name.py Fixed
@suguanYang
suguanYang force-pushed the fix/wangbinqi/internal-filename-length-main branch from a675b85 to 93d9eee Compare August 31, 2026 08:09
@suguanYang

Copy link
Copy Markdown
Contributor Author

Addressed both CodeQL comments in commit 93d9eee: file existence/content are computed before assertions, and the test now uses Path.read_bytes() instead of an unclosed open(). Focused Ruff and pytest checks pass; GitHub checks are rerunning.

@suguanYang
suguanYang merged commit 19b0e28 into main Aug 31, 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.

2 participants