Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughA conditional check was added to filter out inactive solver networks during the mapping process. The code now destructures an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (2)
libs/core/src/cms/utils/mapCmsSolversInfoToSolversInfo.ts (2)
8-10: Please remove complexity suppression in this touched mapperLine 8-9 keeps TODO +
eslint-disablescaffolding while adding more branching here. Extract the network-entry mapping/filter into a small helper and drop the suppression.As per coding guidelines, remove linter scaffolding (
// TODO,eslint-disable) and extract helpers instead of disabling complexity checks.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libs/core/src/cms/utils/mapCmsSolversInfoToSolversInfo.ts` around lines 8 - 10, Remove the TODO and the "// eslint-disable-next-line complexity" from mapCmsSolversInfoToSolversInfo and extract the inner reduce logic that maps/filter solver_networks.data entries into a new small helper (e.g., mapSolverNetworkEntry or filterAndMapSolverNetwork) that returns either a SolverNetwork or null/undefined for invalid entries; then replace the inline reduce callback in solverNetworks with a clear usage of the helper (filtering out falsy results) so the complexity of mapCmsSolversInfoToSolversInfo is reduced and the linter suppression can be removed.
12-17: Prefer allowlisting active entries (active === true) instead of only skippingfalseOn Line 15,
active === falsestill passes through entries whereactiveis missing. If the goal is “only active solvers,” use a positive check and return early for everything else.Suggested change
- // skip inactive solvers - if (active === false) { + // allow only active solvers + if (!active) { return acc }As per coding guidelines, use
!!valuefor explicit boolean conversions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@libs/core/src/cms/utils/mapCmsSolversInfoToSolversInfo.ts` around lines 12 - 17, The current filter skips only explicit false values so entries with missing/undefined active still pass; in mapCmsSolversInfoToSolversInfo replace the negative check (active === false) with a positive allowlist using an explicit boolean conversion (e.g., ensure active is strictly true via !!active or Boolean(active)) and return early for anything else so only entries where active is true are processed (use the entry.attribute name `active` and accumulator `acc` to locate the change).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@libs/core/src/cms/utils/mapCmsSolversInfoToSolversInfo.ts`:
- Around line 8-10: Remove the TODO and the "// eslint-disable-next-line
complexity" from mapCmsSolversInfoToSolversInfo and extract the inner reduce
logic that maps/filter solver_networks.data entries into a new small helper
(e.g., mapSolverNetworkEntry or filterAndMapSolverNetwork) that returns either a
SolverNetwork or null/undefined for invalid entries; then replace the inline
reduce callback in solverNetworks with a clear usage of the helper (filtering
out falsy results) so the complexity of mapCmsSolversInfoToSolversInfo is
reduced and the linter suppression can be removed.
- Around line 12-17: The current filter skips only explicit false values so
entries with missing/undefined active still pass; in
mapCmsSolversInfoToSolversInfo replace the negative check (active === false)
with a positive allowlist using an explicit boolean conversion (e.g., ensure
active is strictly true via !!active or Boolean(active)) and return early for
anything else so only entries where active is true are processed (use the
entry.attribute name `active` and accumulator `acc` to locate the change).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a61efcf1-c09b-4a29-9bfe-00cbf2891fdb
📒 Files selected for processing (1)
libs/core/src/cms/utils/mapCmsSolversInfoToSolversInfo.ts
elena-zh
left a comment
There was a problem hiding this comment.
Hey @limitofzero , great!
But this is weird on Arbitrum:
Total number of solvers correspond to the active ones on Explorer, but why then more solvers participated that we have active ones?
Same on Avalanche
Could you please check why?
Summary
Remove inactive resolvers from cms
The bug: https://www.notion.so/cownation/Too-many-solvers-3438da5f04ca8065a06cfacf975ef5ba