Eosu 404 auth token reauth p2p disconnects v2#1260
Eosu 404 auth token reauth p2p disconnects v2#1260JessTello wants to merge 1 commit intorelease-6.1.0from
Conversation
JessTello
commented
Mar 19, 2026
- Add a single flight guard s_isConnectAuthExpirationLoginInProgress to the Connect re-login flow to avoid duplicate automatic relogins.
- Gate the AuthExpiration callback in ConfigureConnectExpirationCallback so subsequent notifications return early while a reconnect is in progress.
- Clear the in progress guard when Connect.Login completes and when CreateUser completes so legitimate future retries are allowed.
- Add a single flight guard s_isConnectAuthExpirationLoginInProgress to the Connect re-login flow to avoid duplicate automatic relogins. - Gate the AuthExpiration callback in ConfigureConnectExpirationCallback so subsequent notifications return early while a reconnect is in progress. - Clear the in progress guard when Connect.Login completes and when CreateUser completes so legitimate future retries are allowed.
| // | ||
| public void StartConnectLoginWithOptions(Epic.OnlineServices.Connect.LoginOptions connectLoginOptions, | ||
| OnConnectLoginCallback onloginCallback) | ||
| { |
There was a problem hiding this comment.
There's a very rare edge case where a developer could call this function whilst s_isConnectAuthExpirationLoginInProgress is true and a login attempt is ongoing.
To protect against this I would:
- Move this code into a private function
- Either prefixed with
_or ending inInternal(perhaps there are other cases in the plugin already?) - Add an extra bool param, which is used to indicate whether this is the re-auth attempt
- If it's not the re-auth attempt and
s_isConnectAuthExpirationLoginInProgressis true then call the callbacks with theAlreadyPendingresult (and log a warning explaining what happened)
- Either prefixed with
- Keep this public function and have it call that private function (with false for the new param)
| connectInterface.Login(ref connectLoginOptions, null, | ||
| (ref Epic.OnlineServices.Connect.LoginCallbackInfo connectLoginData) => | ||
| { | ||
| s_isConnectAuthExpirationLoginInProgress = false; |
There was a problem hiding this comment.
Can you add this check? There's a convenient extension function for it in the Epic.OnlineServices namespace.
I've also created a thread to discuss this function in general, as I can't see it used elsewhere.
| s_isConnectAuthExpirationLoginInProgress = false; | |
| if (!connectLoginData.ResultCode.IsOperationComplete()) | |
| { | |
| Log($"Ignoring connect login result that will be retried. ResultCode: {connectLoginData.ResultCode}"); | |
| return; | |
| } | |
| s_isConnectAuthExpirationLoginInProgress = false; |
| //------------------------------------------------------------------------- | ||
| public void CreateConnectUserWithContinuanceToken(ContinuanceToken token, | ||
| OnCreateConnectUserCallback onCreateUserCallback) | ||
| { |
There was a problem hiding this comment.
This is a public function, so as per the comment below there's an edge case where this could be called whilst s_isConnectAuthExpirationLoginInProgress is true. This also means that it also needs to check the bool and early exit
| SetLocalProductUserId(createUserCallbackInfo.LocalUserId); | ||
| } | ||
|
|
||
| s_isConnectAuthExpirationLoginInProgress = false; |
There was a problem hiding this comment.
Could this ever be true here? If we're re-authing then we should never be creating a user
| ref addNotifyAuthExpirationOptions, null, (ref AuthExpirationCallbackInfo callbackInfo) => | ||
| { | ||
| if (s_isConnectAuthExpirationLoginInProgress) | ||
| { |
There was a problem hiding this comment.
Can you add logging here to say that it's being ignored. It could be useful to debug an issue