fix: return actual success from checkIntoMatch and validate relay fragment params#136
Open
fix: return actual success from checkIntoMatch and validate relay fragment params#136
Conversation
…gment params - checkIntoMatch: return success based on affected_rows instead of hardcoded false, so clients can confirm check-in succeeded - match-relay controller: use ParseIntPipe on fragment params to validate they are valid integers (returns 400 on invalid input) instead of unguarded parseInt which could produce NaN Closes 5stackgg/5stack-panel#380
lukepolo
reviewed
Mar 31, 2026
| @Res() response: Response, | ||
| ) { | ||
| this.matchRelayService.getStart(response, matchId, parseInt(fragment)); | ||
| this.matchRelayService.getStart(response, matchId, fragment); |
Contributor
There was a problem hiding this comment.
we need to test this, it may actually be a string. test via enabling relay
Contributor
Author
|
Checked the relay service — The difference: before, a non-numeric fragment would pass Happy to test with relay enabled, or revert to |
Contributor
|
yah we will need to actually test this live. cause just cause the type says its an int,doesnt mean its an int :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
success: falseregardless of outcome. Now returnstruewhen the player's check-in mutation affects rows.parseInt(fragment)with NestJSParseIntPipe— returns 400 Bad Request on non-numeric fragment values instead of passing NaN downstream.Note: The veto condition at line 455 was reviewed and found to be correct (uses
&&within branches,||between them). No change needed.Test plan
success: trueabc) — returns 400Closes 5stackgg/5stack-panel#380