-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: limit clone depth #9716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: limit clone depth #9716
Conversation
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a clone depth limit mechanism to prevent potential stack overflow or performance issues from deeply nested object cloning. The changes modify the clone function to accept a depth parameter and stop cloning when the depth limit is reached.
- Added depth parameter to the
clonefunction with a default value of 5 - Updated the Hierarchy class to explicitly pass a depth limit of 5 when cloning
- Added comprehensive test coverage for the new depth limiting functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/core/src/clone.ts | Added depth parameter and depth checking logic to prevent infinite recursion |
| packages/core/src/hierarchy.ts | Updated clone call to explicitly pass depth limit of 5 |
| packages/core/src/tests/clone.test.ts | Added comprehensive test suite covering clone functionality and depth limiting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
haiodo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please support old behaviour
|
Connected to Huly®: UBERF-13269 |
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
No description provided.