Skip to content

Eosu 404 auth token reauth p2p disconnects v2#1260

Open
JessTello wants to merge 1 commit intorelease-6.1.0from
eosu-404-auth-token-reauth-p2p-disconnects-v2
Open

Eosu 404 auth token reauth p2p disconnects v2#1260
JessTello wants to merge 1 commit intorelease-6.1.0from
eosu-404-auth-token-reauth-p2p-disconnects-v2

Conversation

@JessTello
Copy link
Copy Markdown
Contributor

  • 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.
@JessTello JessTello requested a review from a team March 19, 2026 22:18
@JessTello JessTello changed the base branch from stable to release-6.1.0 March 19, 2026 22:18
@JessTello JessTello requested a review from matt-clarke March 19, 2026 22:22
//
public void StartConnectLoginWithOptions(Epic.OnlineServices.Connect.LoginOptions connectLoginOptions,
OnConnectLoginCallback onloginCallback)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in Internal (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_isConnectAuthExpirationLoginInProgress is true then call the callbacks with the AlreadyPending result (and log a warning explaining what happened)
  • 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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add logging here to say that it's being ignored. It could be useful to debug an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants