As diagnosed with a community member in the MAS room.
The root cause is that the HTTP Expires header is being read for an absolute timestamp, yet the client and server may have desynchronised clocks.
If the server is a minute or more slower than the client, the rendezvous session will be immediately DELETEd causing the sign-in to fail.
I'm told that Element X shows the error 'Something went wrong An unexpected error occurred. Please try again' in this case.
This section of code appears to be at fault:
|
const expires = res.headers.get("expires"); |
|
if (expires) { |
|
if (this.expiresTimer) { |
|
clearTimeout(this.expiresTimer); |
|
this.expiresTimer = undefined; |
|
} |
|
this.expiresAt = new Date(expires); |
|
this.expiresTimer = setTimeout(() => { |
|
this.expiresTimer = undefined; |
|
this.cancel(ClientRendezvousFailureReason.Expired); |
|
}, this.expiresAt.getTime() - Date.now()); |