Skip to content

infinite loop fix in any collection page#1615

Merged
ragnep merged 2 commits intomainfrom
delegation-center-loop-fix
Nov 24, 2025
Merged

infinite loop fix in any collection page#1615
ragnep merged 2 commits intomainfrom
delegation-center-loop-fix

Conversation

@ragnep
Copy link
Copy Markdown
Contributor

@ragnep ragnep commented Nov 24, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Prevented stale query parameters from persisting when moving between delegation sections, avoiding incorrect pre-filled values.
    • Adjusted reset behavior to stop unnecessary re-invocations, resulting in more stable delegation UI.
  • Performance

    • Reduced redundant state updates during delegation workflow transitions for smoother navigation.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: ragnep <ragneinfo@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 24, 2025

Walkthrough

Moved conditional clearing of query parameters from query parsing to navigation handling and narrowed a component useEffect dependency to only depend on resolved account address. No exported APIs changed.

Changes

Cohort / File(s) Summary
Navigation / Query reset
app/delegation/[...section]/page.client.tsx
Removed automatic resets from getQueryParams; added conditional resets in updatePath so addressQuery is cleared when navigating away from CHECKER/ASSIGN_PRIMARY_ADDRESS, and collectionQuery/useCaseQuery are cleared when not navigating to REGISTER_DELEGATION.
Component useEffect deps
components/delegation/CollectionDelegation.tsx
Adjusted useEffect to depend only on accountResolution.address, removing reset from the dependency array (comment notes useEffectEvent functions should not be listed).

Sequence Diagram(s)

sequenceDiagram
    participant UI
    participant Router
    participant PageClient as page.client.tsx
    participant Component as CollectionDelegation

    UI->>Router: navigate(to section)
    Router->>PageClient: updatePath(newSection)
    alt newSection is CHECKER or ASSIGN_PRIMARY_ADDRESS
        PageClient-->>PageClient: keep addressQuery
    else
        PageClient-->>PageClient: clear addressQuery
    end
    alt newSection is REGISTER_DELEGATION
        PageClient-->>PageClient: keep collectionQuery / useCaseQuery
    else
        PageClient-->>PageClient: clear collectionQuery / useCaseQuery
    end
    PageClient->>Component: render with updated queries
    Component-->>Component: useEffect triggered on accountResolution.address only
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review updatePath conditional branches for correct section names and edge cases.
  • Verify getQueryParams still returns expected values when called independently.
  • Confirm CollectionDelegation behavior around when reset should run after the dependency change.

Possibly related PRs

  • lint errors #1586 — changes CollectionDelegation.tsx reset invocation / dependency behavior (very likely related).

Suggested reviewers

  • prxt6529

Poem

🐇✨ I hopped through routes and cleared the air,
Tossing stale queries with rabbit flair,
One dep trimmed clean, the path runs bright,
Small leaps, neat code — moonlit delight. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'infinite loop fix in any collection page' clearly describes the main change - fixing an infinite loop issue in collection page components by adjusting useEffect dependency arrays and query parameter handling logic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch delegation-center-loop-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7bc25eb and 8eabb14.

📒 Files selected for processing (2)
  • app/delegation/[...section]/page.client.tsx (1 hunks)
  • components/delegation/CollectionDelegation.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/delegation/[...section]/page.client.tsx
  • components/delegation/CollectionDelegation.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: ragnep <ragneinfo@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

@ragnep ragnep merged commit a79caed into main Nov 24, 2025
8 checks passed
@ragnep ragnep deleted the delegation-center-loop-fix branch November 24, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants