-
Notifications
You must be signed in to change notification settings - Fork 189
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(torii-grpc): nullable enum array deser #2887
Conversation
Pull Request AnalysisOhayo, sensei! Let's dive into the changes with precision and clarity. WalkthroughThe pull request introduces modifications to the Changes
Sequence DiagramsequenceDiagram
participant Func as map_row_to_ty
participant Array as Serialized Array
Func->>Array: Check array content
alt Empty Array
Func-->>Func: Early return with empty vector
else Non-Empty Array
Func->>Func: Continue normal processing
end
The sequence diagram illustrates the new control flow for handling empty serialized arrays, showing the early return mechanism when an empty array is detected. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
crates/torii/sqlite/src/model.rs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: docs
- GitHub Check: clippy
🔇 Additional comments (1)
crates/torii/sqlite/src/model.rs (1)
379-382
: Ohayo! Nice defensive programming, sensei!The early return for empty serialized arrays is a good addition that prevents potential deserialization errors.
crates/torii/sqlite/src/model.rs
Outdated
@@ -533,6 +537,7 @@ pub async fn fetch_entities( | |||
query += &format!(" OFFSET {}", offset); | |||
} | |||
|
|||
println!("{}", query); |
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.
🛠️ Refactor suggestion
Consider using a proper logging framework instead of println
Ohayo! While logging the SQL query is helpful for debugging, using println!
in production code isn't ideal. Consider using the tracing
or log
crate instead, which provides structured logging with different log levels.
- println!("{}", query);
+ tracing::debug!(?query, "executing fetch query");
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
println!("{}", query); | |
tracing::debug!(?query, "executing fetch query"); |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2887 +/- ##
==========================================
- Coverage 55.82% 55.81% -0.02%
==========================================
Files 449 449
Lines 57693 57697 +4
==========================================
- Hits 32206 32201 -5
- Misses 25487 25496 +9 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
Bug Fixes
Chores