Repository navigation
Conversation
…ison and score outbox The merge of #2086 over #2230 put back the first ResultsBackend: a retry was compared by grant counts only, so a different payload for a committed match was accepted as a no-op retry; record values were kept by reference; empty keys were accepted; and the score outbox, ScoreSink, DeliverScores and the Record, Balance and BestScore readers were gone along with their tests and the gameserver guide section. This restores #2230's version with the doc comments main added since, and documents that the in-memory outbox does not survive a crash.
Expire ran without the queue lock that #2218 added, racing with Enqueue and Match. The merge of #2218 and #2339 dropped the Enqueue check that refuses a party larger than one team, and the Ticket.Deadline comment. splitTicketTeams skipped a party that fit no team, so Matchup.Teams could leave players out of a formed match; it now reports failure, the default rule adds a party only when the teams can still hold it, and Match does not form a room a custom rule returns that cannot be split. Also documents the ticket fields and term kinds, moves defaultRule's comment back onto it, and uses ensureJobs' result instead of re-reading Match.jobs.
…nd metadata in SQL The merge of #2085 over #2232 dropped the Board checks that refuse an unknown operator, an out-of-range metadataMaxBytes and a set, increment or decrement board without signed validation, so a typo acted as set and any client could submit increments; it also put back #2085's test that expected an unsigned increment board to load. The SQL store from #2092 and #2227 stored neither the subscore nor the metadata and kept the higher score on every board, so after a restart a set or decrement board read back an older score. Schema version 2 adds both columns, migrating a version 1 database, and Save follows the board's operator and subscore. The guide sections #2232, #2092 and #2227 added (operators and monthly periods, SQL persistence, the leaderboardd store flags) were lost in the merge too; they are restored in both languages with the HTTP fields the operators added, and #2227's tie and stale retry test is back.
#2081's Tournament kept one score and attempt map for the whole tournament, so MaxAttempts never reset between rounds and every round settled with the scores of all earlier ones. EndRound only looked at the round just before now, so a late call skipped rounds, a last round that End cut short was never settled, and a tournament with no End and no Duration settled its only round on the first call. OnRoundEnd also ran under the lock, deadlocking a callback that called Entrants. Rounds now keep their own state, EndRound settles every ended round in order and calls OnRoundEnd after unlocking, and a submission to a settled round is refused.
Portal.Rewarded granted a reward an SDK reported after the break's context had already timed out, against its contract that timeouts never grant. Account.LinkIdentity returned an AccountConflict with no provider, a refresh that finished after SignOut wrote the old account's token and ID back, and the token request accepted an empty URL. The game-side client section #2120 added to the accounts guide was lost in the merge and is restored in both languages, the placeholder note and changelog fragment that duplicated #2120's own are removed, and the portal constants, hooks and errors get doc comments.
This branch has not been deployed
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.
Follow-up review of the online pull requests merge/2387 landed without CI: the gameserver matchmaking, results and async jobs PRs, the self-hosted leaderboard tournament, operator and SQL store PRs, and the liveops portal, crash fingerprint and account client PRs. Each PR was compared line by line with current main and read for correctness.
#2218 feat(gameserver): add matchmaking ticket queries
Landed intact, but
Matchmaker.Expire(added by #2339 on top) iterated and deleted from the queue without the mutex this PR introduced, so it raced withEnqueueandMatch. This PR splits it into a lockedExpireand an internalexpireLockedused byMatch, documents the newTicketfields andTermKindconstants, and movesdefaultRule's comment back onto it (the merge left it oncloneStrings). The issue's YAML queue file form (#1689) was not implemented; #1689 was closed by another PR.#2230 feat(gameserver): commit match results idempotently
Overwritten by the older #2086 in the merge. Main compared a retry only by grant counts, so a different payload for a committed match was accepted as an idempotent retry; record bytes were kept by reference; empty keys were accepted; and the score outbox (
ScoreSink,DeliverScores,PendingScores), theRecord,BalanceandBestScorereaders, three of the four tests and the guide section were gone. This PR restores #2230'sresults.goandresults_test.gowith main's doc comments, and the guide section in both languages, which now says plainly that the in-memory outbox does not survive a crash.#2339 feat(gameserver): add matchmaking ticket expiry and teams
The merge dropped the
Enqueuecheck that refuses a party larger than one team or aTeamscount that does not divideRoomSize(an acceptance item of #1322).splitTicketTeamsalso skipped a party that fit no team, so a formed match could leave players out ofMatchup.Teams(three pairs for two teams of three). This PR restores the check; the split now reports failure, the default rule adds a party only when the teams can still hold it, andMatchdoes not form a room a customRulereturns that cannot be split. Tests cover the oversize party, the unsplittable room and concurrentExpire.#2340 feat(gameserver): add bounded async match jobs
OK. Only the comment wrapping of
PendingTimeoutandMaxPendingchanged in the merge.SerialandGonow useensureJobs' return value instead of re-readingMatch.jobsoutside its mutex.#2081 feat(leaderboard): add tournament lifecycle core
Landed intact but buggy: scores and attempts were one map for the whole tournament, so
MaxAttemptsnever reset between rounds and each round settled with every earlier round's scores;EndRoundonly looked at the round just beforenow, so a late call skipped rounds, a last round cut short byEndnever settled, and a tournament with noEndsettled its only round on the first call;OnRoundEndran under the lock, so a callback callingEntrantsdeadlocked. This PR keeps per-round state, settles every ended round once and in order outside the lock, and refuses a submission to a settled round. It still does not meet #1682's acceptance (config format, service and HTTP routes, restart-safeOnRoundEnd).#2085 feat(leaderboard): add operators and monthly periods / #2232 feat(leaderboard): add score operators and metadata
Two attempts at #1681. The merge kept #2232's service code but #2085's config validation and test: the checks refusing an unknown operator, an out-of-range
metadataMaxBytesand aset,incrementordecrementboard withoutvalidation: signedwere gone, so a typo behaved assetand any client could submit increments, and the remaining test asserted that an unsigned increment board loads. Both PRs' guide sections were dropped. This PR restores #2232's validation, test file and guide section (both languages, with the HTTP fields), and updates the note in place. A server proof still signs only board, account and score, so subscore and metadata stay client-controlled on signed boards; the guide and note now say so.#2092 / #2227 feat(leaderboard): add SQLite and Postgres stores
Two near-identical attempts at #1680. The code landed once; #2227's tie and stale retry test and both guide sections were dropped. The store also ignored #2232's fields: it persisted neither subscore nor metadata, and kept the higher score on every board, so a
setordecrementboard read back an older score after a restart. This PR adds schema version 2 (subscore and metadata columns, migrating a version 1 database), makesSavefollow the board's operator and subscore, restores the test, adds tests for the new columns and the migration, and restores the guide sections and theleaderboarddflags. #1680 itself remains open: ranking is still in memory.#2095 feat(liveops): add web portal ad breaks
Rewardedgranted a reward that an SDK reported after the break had timed out, contrary to its contract. This PR refuses it when the call's context has ended and adds a test, plus doc comments on the provider constants, hooks andErrPortalTimeout.#2116 feat(liveops): add crash report fingerprints
OK. Main's
Fingerprintis a later revision of this PR's (with asha256:prefix and argument stripping); the docs match it.#2120 feat(liveops): add game-side accounts client
The guide sections in
accounts.mdwere dropped, and the PR carried two notes and two changelog fragments for the same change, one of them a placeholder.LinkIdentityreturned anAccountConflictwithout its provider, and a refresh finishing afterSignOutwrote the old token and account ID back. This PR fixes both with tests, restores one merged guide section in both languages, and removes the duplicate note and fragment.Verification
go tool nsgo test ./pkg/online/gameserver/... ./pkg/online/leaderboard/... ./pkg/online/liveops/... ./cmd/leaderboardd/...(and-raceon the touched tests)go tool nsgo checkon each of those packagesgo tool nsgo test ./internal/repocheck/...go run ./changelog checkintools,bun run verify-notesScreenshots: None