← Back to Pull requests

feat(RHINENG-28573): update useSystemsViewQuery retry algorithm #3820

Closed
unknown closed this pull request without merging on Nov 21, 2026 12:09 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 14:59 UTC
Author

RHINENG-28573

New SystemsView fetch retry algo.

This PR recovers from situation when page param gets out of range and table would normally end up in an Error. It does by probing for new latest page, by extending Retry algo of SystemsViewQuery. Below is Pseudo code describing retry logic for successful & failed fetch which this PR implements in SystemsView.

This went through few iterations and there doesn't seem to be an easy fix nor fix which would be much less verbose.

lastPage(total) = max(1, ceil(total / perPage))

> on success:

if page > lastPage(total):

replace URL page with lastPage(total) // one correction

if lastPage is 1: render this response // already the full result

else: fetch lastPage // normal retries

else:

render rows, or the empty state when total is 0

> on failure:

if page is 1:

retry this request a few times, then the error screen

else:

do not retry this page

probe page 1, with a few retries

if the probe fails:

error screen

if page > lastPage(probe.total):

replace URL page with lastPage

if lastPage is 1: render the probe response

else: fetch lastPage, with a few retries

if that fails: error screen, no second probe

else:

the page was in range, so this is a real failure

retry the original page a few times, then the error screen`

Summary by Sourcery

Improve SystemsView data fetching so pagination recovers gracefully when result counts change or requested pages fail.

New Features:

  • Recover SystemsView pagination when requested pages become invalid by probing current results and correcting the URL to the latest available page.
  • Bug Fixes:

  • Prevent stale or out-of-range page requests from leaving the SystemsView in an erroneous state.
  • Enhancements:

  • Centralize SystemsView query handling with distinct retry behavior for initial loads, page probes, and confirmed in-range failures.

  • Keep the table in a loading state while pagination recovery is in progress.
  • Tests:

  • Add coverage for out-of-range page correction, failed-page probing, in-range failures, multi-step correction, URL preservation, and retry policies.
  • Diff: 281 lines (+210 / -71) across 3 files Reviewer: h-kataria Review duration: 7029m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 281 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.338
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3820"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.7% (MEDIUM) · Higher = larger blast radius
    39.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.7% · Safe to merge
    15.7%