Skip to content

Fix CI and Code Quality issues in Daily Challenge - #180

Merged
winnerspiros merged 10 commits into
masterfrom
fix/ci-code-quality-daily-challenge-17383618337664907011
Apr 12, 2026
Merged

Fix CI and Code Quality issues in Daily Challenge#180
winnerspiros merged 10 commits into
masterfrom
fix/ci-code-quality-daily-challenge-17383618337664907011

Conversation

@google-labs-jules

Copy link
Copy Markdown

This PR addresses several issues identified in the previous CI runs and CodeQL scans:

  • Fixes potential null dereferences in DailyChallenge.cs by capturing playlistItem in local variables to satisfy nullability checks.
  • Removes unused testScore variables in TestSceneDailyChallengeEventFeed.cs and TestSceneDailyChallengeTotalsDisplay.cs to resolve CI warnings.
  • Updates TestRoomRequestsHandler.cloneRoom to manually preserve RoomID, StartDate, and EndDate, ensuring accurate state propagation in visual tests.
  • Adds the missing JNI constructor to OsuGameActivity.cs required for .NET 10 Android builds to prevent activation crashes.
  • Ensures SpectatorList.cs handles nullable GameplayState safely with appropriate checks.

PR created automatically by Jules for task 17383618337664907011 started by @winnerspiros

@google-labs-jules

Copy link
Copy Markdown
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Comment thread osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs Fixed
Comment thread osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs Fixed
…enge

- Fix potential null dereferences in `DailyChallenge.cs` by capturing `playlistItem` in local variables.
- Remove redundant null checks and conditional access on non-nullable `room` field in `DailyChallenge.cs`.
- Remove unused `testScore` variables in Daily Challenge visual tests to resolve CI warnings.
- Update `TestRoomRequestsHandler.cloneRoom` to preserve `RoomID`, `StartDate`, and `EndDate` for test stability.
- Add missing JNI constructor to `OsuGameActivity.cs` for .NET 10 Android compatibility.
- Ensure `SpectatorList.cs` handles `GameplayState` safely with null checks.
- Fix robust identification of `LocalUser` in `MultiplayerClient` by using `UserID` instead of `User.Id`, preventing null assertion failures during room setup.
- Fix potential null dereferences in `DailyChallenge.cs` using local variable captures.
- Remove redundant null checks on non-nullable `room` field in `DailyChallenge.cs`.
- Correct `DailyChallengeCarousel.Remove` to properly remove all navigation dots.
- Update `TestRoomRequestsHandler.cloneRoom` to preserve `RoomID`, `StartDate`, and `EndDate`.
- Add JNI constructor to `OsuGameActivity.cs` for .NET 10 Android builds.
- Remove unused variables in visual tests to resolve CI warnings.
- Use `UserID` for robust `LocalUser` identification in `MultiplayerClient`.
- Add null check for `user.User` in `PlayerPanelOverlay` to prevent crashes.
- Fix nullability and redundant checks in `DailyChallenge.cs`.
- Fix navigation dot removal logic in `DailyChallengeCarousel`.
- Add missing JNI constructor to `OsuGameActivity` for .NET 10 Android.
- Clean up unused variables and improve field preservation in visual tests.
- Manually preserve `User` identity in `TestMultiplayerClient` cloning to prevent UI crashes.
- Add robust null safety to `RankedPlayMatchInfo` and `AvatarOverlay` components.
- Fix logic and assertions in `TestScenePlayerPanelOverlay` to correctly track user exit state.
- Resolve strict build failures (formatting, unused variables, and CA1829).
public bool AddUser(APIUser user)
{
if (avatars.Any(a => a.User.Id == user.Id))
if (user == null || avatars.Any(a => a.User?.Id == user.Id))
public RankedPlayRoomState RoomState { get; private set; } = null!;

public bool IsOwnTurn => RoomState.ActiveUserId == client.LocalUser?.UserID;
public bool IsOwnTurn => RoomState != null && client.LocalUser != null && RoomState.ActiveUserId == client.LocalUser.UserID;
Comment thread osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs Fixed
- Restore `User` identity in `TestMultiplayerClient` cloning to prevent UI crashes.
- Add robust null safety to `GameplayWarmupScreen`, `RankedPlayMatchInfo`, and `AvatarOverlay`.
- Use `UserID` for robust `LocalUser` identification in `MultiplayerClient`.
- Fix navigation dot removal logic in `DailyChallengeCarousel`.
- Add JNI constructor to `OsuGameActivity` for .NET 10 Android.
- Clean up unused variables and improve field preservation in visual tests.
lastLookupResult.Value = SongSelect.BeatmapSetLookupResult.Completed(beatmap.BeatmapSet);
APIBeatmap? beatmap = null;
var item = Client.Room?.CurrentPlaylistItem;
if (item != null)
- Restore `User` identity in `TestMultiplayerClient` cloning.
- Add null safety to `GameplayWarmupScreen`, `RankedPlayMatchInfo`, and `AvatarOverlay`.
- Use `UserID` for robust `LocalUser` identification in `MultiplayerClient`.
- Fix blank line and line-break formatting in `GameplayWarmupScreen.cs`.
- Fix navigation dot logic in `DailyChallengeCarousel`.
- Resolve visual test regressions and strict build failures.
- Restore `User` property in `TestMultiplayerClient.clone` to prevent identity loss during testing.
- Improve `LocalUser` identification in `MultiplayerClient` to handle initialization race conditions.
- Add null safety guards to `GameplayWarmupScreen`, `RankedPlayMatchInfo`, `PlayerPanelOverlay`, and `AvatarOverlay`.
- Resolve CodeQL nullability alerts (#225, #236) in `DailyChallenge.cs`.
- Fix navigation dot logic in `DailyChallengeCarousel`.
- Update `TestRoomRequestsHandler` to preserve critical room fields during cloning.
- Resolve all strict code style and formatting build errors (IDE0055, IDE0031, etc.).
Comment thread osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs Fixed
Comment thread osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs Fixed
- Restore `User` property in `TestMultiplayerClient.clone` to prevent identity loss.
- Improve `LocalUser` identification robustness in `MultiplayerClient`.
- Add null safety guards to `GameplayWarmupScreen`, `RankedPlayMatchInfo`, `PlayerPanelOverlay`, and `AvatarOverlay`.
- Resolve CodeQL alerts and bot feedback in `DailyChallenge.cs`.
- Fix navigation dot logic in `DailyChallengeCarousel`.
- Correct formatting and line breaks in `GameplayWarmupScreen.cs`.
- Ensure strict build and style compliance.
@winnerspiros
winnerspiros merged commit 3c5a088 into master Apr 12, 2026
7 of 15 checks passed
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