fix(core): consolidate diff size constants into packages/core/src/dif…#31928
fix(core): consolidate diff size constants into packages/core/src/dif…#31928qian-jiahong wants to merge 1 commit into
Conversation
…f-constants.ts Fixes issues/31655
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
updated. |
|
The following comment was made by an LLM, it may be inaccurate: Found potential related PRs:
These PRs are related to the same problem domain (preventing renderer freeze on large diffs), though PR #31928 takes a different approach by consolidating diff size constants and implementing a three-layer defense strategy at the core/API level rather than just UI optimization. |
Issue for this PR
Closes #31655 (fix: #31655)
Type of change
What does this PR do?
MAX_RECONSTRUCT_BYTES) as defense-in-depth: skip expensive content reconstruction + re-diff, fall through to fast unified-diff parserNumber.MAX_SAFE_INTEGERto avoid wasted Myers diff on large filesHow did you verify your code works?
Capped at 1MB during snapshot generation (snapshot/index.ts)
Discarded >1MB at the per-file diff endpoint (summary.ts)
Stripped >100KB from messages API responses (message-v2.ts)
Skipped content reconstruction on the frontend for patches >100KB, falling through to the fast parsePatchFiles path (session-diff.ts)
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist