← Back to Pull requests

fix(accounts): return empty results when user search has no matches #21043

Closed
unknown closed this pull request without merging on Nov 24, 2026 17:31 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 13:33 UTC
Author

  • Addresses one half of #20996 by returning an empty list (200) instead of raising (404).

  • Unlike the rate limited branch, which returns an empty list to work around a library limitation (ref: https://github.com/afcapel/stimulus-autocomplete/issues/136), I don't believe this is a workaround.

  • - IMO this is returning a "list of something" (in this case, accounts), so returning a 404 didn't quite fit.
    - There is precedent in warehouse for returning a 200 instead of 404 when a search has no results, eg: /search/?q=thisdoesnotexist
  • The same problem happens with characters that are valid in usernames, not just @.
  • Verified manually

    <table>
    <tr>
    <th colspan="2">Setup: typing "alc" shows a bunch of results</th>
    </tr>
    <tr>
    <td colspan="2" align="center"><img width="500" height="274" alt="image" src="https://github.com/user-attachments/assets/ef5b6973-d85f-4598-8c10-1fd8818b5c50" /></td>
    </tr>
    <tr>
    <th>Before (previous results, 404 from <code>/accounts/search/</code>, also console errors)</th>
    <th>After (no results, 200 from <code>/accounts/search/</code>, no console errors)</th>
    </tr>
    <tr>
    <th colspan="2">Continue typing "alc@"</th>
    </tr>
    <tr>
    <td><img width="500" height="256" alt="image" src="https://github.com/user-attachments/assets/4e59d509-b52d-4f8e-9609-496a793d332c" /></td>
    <td><img width="500" height="366" alt="image" src="https://github.com/user-attachments/assets/63a80f2b-2fcd-4316-8c7f-a8ce54fdacae" /></td>
    </tr>
    <tr>
    <th colspan="2">Continue typing "alcc"</th>
    </tr>
    <tr>
    <td><img width="500" height="306" alt="image" src="https://github.com/user-attachments/assets/fcc96ddb-a411-41ca-891c-4ffeed3bc22e" /></td>
    <td><img width="500" height="324" alt="image" src="https://github.com/user-attachments/assets/a06c3ae0-6dfc-4fc7-ac4f-36ea7e155499" /></td>
    </tr>
    </table>

    Diff: 238 lines (+178 / -60) across 2 files Reviewer: miketheman Review duration: 3118m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 238 lines diff across 2 files
    0.42
    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.328
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #21043"
    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: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    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: 16.7% · Safe to merge
    16.7%
    Repository