Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughUpdated Hive client defaults (longer timeout, higher failover threshold), added try/catch around a posts API call to log errors and return null on failure, and bumped package versions + changelog entries for sdk and wallets. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/sdk/src/modules/posts/queries/get-waves-by-host-query-options.ts`:
- Around line 42-52: The RPC catch block in get-waves-by-host-query-options.ts
that calls CONFIG.hiveClient.call("bridge","get_account_posts", rpcParams)
should not return null (which makes queryFn return an empty array and hides
transient failures); instead rethrow or propagate the error so upstream
retry/error handling runs. Replace the current catch that logs and returns null
with logic that logs the error and then throw err (or return
Promise.reject(err)) from the same scope (the container retrieval for variable
containers) so that get_account_posts failures surface to queryFn and trigger
retries.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/sdk/src/modules/core/config.tspackages/sdk/src/modules/posts/queries/get-waves-by-host-query-options.ts
| let containers: WaveEntry[]; | ||
| try { | ||
| containers = (await CONFIG.hiveClient.call( | ||
| "bridge", | ||
| "get_account_posts", | ||
| rpcParams | ||
| )) as WaveEntry[]; | ||
| } catch (err) { | ||
| console.error("[SDK] getThreads get_account_posts error:", err); | ||
| return null; | ||
| } |
There was a problem hiding this comment.
Don’t convert RPC failures into a successful empty result.
At Line 51, returning null causes queryFn (Line 115) to return [], so transient RPC failures look like “no waves” and skip normal error/retry handling.
💡 Suggested fix
} catch (err) {
console.error("[SDK] getThreads get_account_posts error:", err);
- return null;
+ throw err instanceof Error ? err : new Error("get_account_posts failed");
}📝 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.
| let containers: WaveEntry[]; | |
| try { | |
| containers = (await CONFIG.hiveClient.call( | |
| "bridge", | |
| "get_account_posts", | |
| rpcParams | |
| )) as WaveEntry[]; | |
| } catch (err) { | |
| console.error("[SDK] getThreads get_account_posts error:", err); | |
| return null; | |
| } | |
| let containers: WaveEntry[]; | |
| try { | |
| containers = (await CONFIG.hiveClient.call( | |
| "bridge", | |
| "get_account_posts", | |
| rpcParams | |
| )) as WaveEntry[]; | |
| } catch (err) { | |
| console.error("[SDK] getThreads get_account_posts error:", err); | |
| throw err instanceof Error ? err : new Error("get_account_posts failed"); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/sdk/src/modules/posts/queries/get-waves-by-host-query-options.ts`
around lines 42 - 52, The RPC catch block in get-waves-by-host-query-options.ts
that calls CONFIG.hiveClient.call("bridge","get_account_posts", rpcParams)
should not return null (which makes queryFn return an empty array and hides
transient failures); instead rethrow or propagate the error so upstream
retry/error handling runs. Replace the current catch that logs and returns null
with logic that logs the error and then throw err (or return
Promise.reject(err)) from the same scope (the container retrieval for variable
containers) so that get_account_posts failures surface to queryFn and trigger
retries.
Fixes #682
Summary by CodeRabbit
Bug Fixes
Chores