Repository navigation
fix(server/events): capture identifiers before async user lookup - #776
Merged
Merged
Conversation
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.
Description
onPlayerConnectingreadlicensesynchronously but only calledgetIdentifiers(src)after awaitingstorage.fetchUserByIdentifier. If anotherplayerConnectinghandler rejects the connection during that await, the temporary source can already be invalid, so the snapshot only containsusernameandcreateUserinserts a row with NULLlicense/license2/fivem/discord. Those rows are never matched again, so every retried rejected connection adds another.The identifier snapshot is now taken at the same point as
license, before the deferral yields, so a created row always carries the identifiers it is looked up by.Related Issues
Fixes #772
Type of Change
Testing
Code-path review of
onPlayerConnecting,getIdentifiers,createUserandLogin; luacheck reports no new warnings. Not tested on a live server.