Skip to content

a - #248

Merged
winnerspiros merged 3 commits into
winnerspiros:masterfrom
ppy:master
Apr 23, 2026
Merged

a#248
winnerspiros merged 3 commits into
winnerspiros:masterfrom
ppy:master

Conversation

@winnerspiros

@winnerspiros winnerspiros commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary by Gitar

  • Error handling:
    • Modified ScoreSubmission to refine how submission errors are processed and logged.
    • Adjusted conditional logic in ScoreSubmission to improve response to network or validation failures.

This will update automatically on new commits.

Summary by CodeRabbit

  • Tests

    • Added test case for keyboard navigation with empty card hand.
  • Bug Fixes

    • Fixed potential crash when navigating cards with keyboard on empty collection.
    • Improved user-facing error messages for score submission failures.
  • Localization

    • Updated matchmaking interface labels (Wins, Plays, Points, Rating) and headers to support localized strings.

diquoks and others added 3 commits April 23, 2026 10:31
Resolves #37486

Original error log:
```
2026-04-22 21:47:58 [error]: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
2026-04-22 21:47:58 [error]: at System.Collections.Generic.List`1.get_Item(Int32 index)
2026-04-22 21:47:58 [error]: at osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand.PlayerHandOfCards.moveCardFocus(Int32 direction)
2026-04-22 21:47:58 [error]: at osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Hand.PlayerHandOfCards.OnKeyDown(KeyDownEvent e)
```

Currently,
```osu.Game\Screens\OnlinePlay\Matchmaking\RankedPlay\Hand\PlayerHandOfCards.cs::moveCardFocus```
does not account for the hand being empty (cards.Count ==0 ), and will
attempt to move the card focus in the given direction regardless, which
causes the above index out of range error.

Added empty hand check to moveCardFocus, and a matching test case to
TestScenePlayerCardHand.cs

New test case before changes, recreating the error:
<img width="986" height="232" alt="image"
src="https://github.com/user-attachments/assets/daa62081-c776-44bd-b0d2-382b2dac7938"
/>

After:
<img width="638" height="223" alt="image"
src="https://github.com/user-attachments/assets/d6dcd8b8-8caf-42e3-9999-93dfe3fb6452"
/>
Based on internal feedback.

I was going to apply other changes (like always posting to sentry) but
don't want to go too far down a rabbit hole, so just fixed messaging a
bit.
@winnerspiros
winnerspiros merged commit 1fbcc49 into winnerspiros:master Apr 23, 2026
1 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9ada2ba-cf45-469a-9591-009ee3b01947

📥 Commits

Reviewing files that changed from the base of the PR and between e5e4867 and c9ad0e4.

📒 Files selected for processing (5)
  • osu.Game.Tests/Visual/RankedPlay/TestScenePlayerCardHand.cs
  • osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs
  • osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsTooltip.cs
  • osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Hand/PlayerHandOfCards.cs
  • osu.Game/Screens/Play/SubmittingPlayer.cs

📝 Walkthrough

Walkthrough

This PR introduces a test for empty card hand keyboard navigation, adds a safety guard against index errors in card hand focus logic, and improves localization and error messaging in matchmaking and score submission components across five files.

Changes

Cohort / File(s) Summary
Card Hand Testing and Logic
osu.Game.Tests/Visual/RankedPlay/TestScenePlayerCardHand.cs, osu.Game/Screens/OnlinePlay/Matchmaking/RankedPlay/Hand/PlayerHandOfCards.cs
New test validates keyboard navigation with empty card hand; guard clause added to moveCardFocus() to prevent invalid index access when no cards are present.
Matchmaking UI Localization
osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsDisplay.cs, osu.Game/Overlays/Profile/Header/Components/MatchmakingStatsTooltip.cs
Hardcoded matchmaking labels replaced with localized string references (UsersStrings.ShowMatchmakingTitle, RankingsStrings constants).
Score Submission Error Handling
osu.Game/Screens/Play/SubmittingPlayer.cs
Token and score submission error handling refactored to use centralized getUserFacingAPIError() helper; improved error context messages for API failures.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • a #217: Shares ranked-play "hand of cards" functionality changes affecting both test cases and core card navigation logic.

Poem

🐰 A paw upon the keyboard pressed,
When cards are gone, we guard the rest,
Localization strings now shine so bright,
Errors speak in clearer light,
The hand stands firm, resilient and true! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@gitar-bot

gitar-bot Bot commented Apr 23, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

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.

4 participants