Fix CI and Code Quality issues in Daily Challenge - #180
Conversation
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
…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; |
- 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.).
- 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.
This PR addresses several issues identified in the previous CI runs and CodeQL scans:
PR created automatically by Jules for task 17383618337664907011 started by @winnerspiros