fix(worker): prevent long internal parser filenames - #357
Merged
Merged
Conversation
suguanYang
force-pushed
the
fix/wangbinqi/internal-filename-length-main
branch
from
August 31, 2026 08:09
a675b85 to
93d9eee
Compare
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.