-
Notifications
You must be signed in to change notification settings - Fork 1
fix: update merge fields logic test 2 #10
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
base: main
Are you sure you want to change the base?
Conversation
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.
Configure merge blocking · Maintainers can dismiss this review. Gitar never auto-approves.
crates/lib/src/lib.rs
Outdated
| /// Creates a PrismaValue::Object from a list of key-value pairs. | ||
| /// If a key has multiple values that are PrismaValue::Objects, they will be merged. | ||
| pub fn merge_fields(fields: Vec<(String, PrismaValue)>) -> Vec<(String, PrismaValue)> { | ||
| todo!(); |
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.
🚨 Bug: todo!() will panic at runtime, breaking the function
Suggested fix
The todo!() macro is added at the very beginning of merge_fields(). This macro panics at runtime when executed, meaning any code that calls merge_fields will crash immediately.
The existing implementation below the todo!() will never execute since the panic happens first.
Impact: This is a production-breaking change. Any feature depending on merge_fields will fail with a panic.
Suggested fix: Remove the todo!() line. If this is meant to be placeholder code for a work-in-progress implementation, consider:
- Using a feature flag to gate the new implementation
- Keeping this in a separate branch until the implementation is complete
- If the function needs to be rewritten, replace the entire implementation rather than adding
todo!()before working code
Was this helpful? React with 👍 / 👎
- Apply suggested fix
|
Gitar fix ci |
Fixed! Removed the |
Code Review 🚫 Blocked 0 resolved / 1 findingsCritical bug persists: 🚨 Bug: `todo!()` will panic at runtime, breaking the functionThe The existing implementation below the Impact: This is a production-breaking change. Any feature depending on Suggested fix: Remove the
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Description
Issues
Test Plan
Revert Plan
Summary by Gitar
todo!()macro inserted atcrates/lib/src/lib.rs:120markingmerge_fieldsfunction for future implementationThis will update automatically on new commits.