-
Notifications
You must be signed in to change notification settings - Fork 7
cleanup bad transactions from pending in peek #65
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
Conversation
WalkthroughInternal refactor of pending transaction retrieval in Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Store as EOA Store
participant DB as Storage/DB
Caller->>Store: get_pending_transactions()
Note over Store: Iterate pending entries (stream)
loop For each pending entry
Store->>DB: fetch user_request by key
alt user_request exists
Store->>Store: attempt JSON decode (optional)
alt decode success
Store-->>Caller: yield EoaTransactionRequest
else decode fails
Store->>DB: delete pending entry (cleanup)
Note over Store,DB: Error-tolerant cleanup on decode failure
end
else user_request missing
Store->>Store: log warning
Store->>DB: delete pending entry
end
end
Store-->>Caller: stream completes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
executors/src/eoa/store/mod.rs
(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
executors/src/eoa/store/mod.rs (3)
executors/src/external_bundler/deployment.rs (4)
conn
(40-42)conn
(54-54)conn
(69-71)conn
(197-197)twmq/src/lib.rs (7)
new
(132-151)redis
(1221-1223)redis
(1229-1229)redis
(1321-1323)redis
(1329-1329)redis
(1359-1361)redis
(1367-1369)executors/src/eoa/store/hydrate.rs (1)
deletion_pipe
(113-114)
if !deletion_pipe.is_empty() { | ||
deletion_pipe.query_async::<()>(&mut conn).await?; | ||
} |
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.
Fix deletion pipeline result type to avoid runtime failure
query_async::<()>
expects a Redis Nil
, but a pipeline of ZREM
commands returns a bulk of integer counts, so this call will throw a ResponseError
as soon as cleanup runs. Capture the results as a vector (or Value
) instead.
- deletion_pipe.query_async::<()>(&mut conn).await?;
+ let _: Vec<i64> = deletion_pipe.query_async(&mut conn).await?;
📝 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.
if !deletion_pipe.is_empty() { | |
deletion_pipe.query_async::<()>(&mut conn).await?; | |
} | |
if !deletion_pipe.is_empty() { | |
let _: Vec<i64> = deletion_pipe.query_async(&mut conn).await?; | |
} |
🤖 Prompt for AI Agents
In executors/src/eoa/store/mod.rs around lines 605 to 607, the pipeline call
uses query_async::<()> which expects a Redis Nil but the pipeline of ZREM
commands returns integer counts; change the query type to capture the actual
results (e.g., use query_async::<Vec<redis::Value>>() or
query_async::<Vec<i64>>()) and bind the returned value to a variable (or let _ =
...) instead of expecting unit, so the pipeline response is consumed without
causing a ResponseError.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor