Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable26] Fix using signaling settings while being refetched #10259

Merged
merged 2 commits into from Aug 18, 2023

Conversation

backportbot-nextcloud[bot]
Copy link

Backport of #8427

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When the external signaling server returns the error "token_expired" the
signaling settings are fetched again. However, if there are further
requests and "token_expired" is returned again the previous fetch is
canceled and a new one started instead, which caused the settings to be
temporary set to "null". The signaling settings are expected to always
be an object, so setting them to "null" could cause an error if they
were used during that time (for example, during a reconnection, which
caused the signaling object to "hang" and not do any further connection
attempt).

Preventing the settings to be nullified is only half of the story,
though; "token_expired" can be thrown when trying to connect, and errors
thrown when trying to connect cause a reconnection attempt. This could
end in a reconnection loop, as each "token_expired" error would
cause another fetch of the settings, cancelling the previous fetch and
thus preventing the settings to be updated, and as the previous settings
would be still used any connection attempt would end again in another
"token_expired" error.

To solve all that now any connection attempt done after receiving a
"token_expired" error is deferred until the signaling settings were
updated.

Note that the previous signaling settings are kept to ensure that a
signaling object is always available, even if outdated. However, any
usage of the outdated signaling settings is expected to cause a
"token_expired" error to be thrown; right now that only happens during
connections, so only that code needs to wait for the settings to be
fetched again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@backportbot-nextcloud backportbot-nextcloud bot added bug feature: signaling 📶 Internal and external signaling backends labels Aug 17, 2023
@backportbot-nextcloud backportbot-nextcloud bot added this to the 🧡 Next Patch (26) milestone Aug 17, 2023
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@danxuliu danxuliu merged commit 4f1a3f2 into stable26 Aug 18, 2023
19 checks passed
@danxuliu danxuliu deleted the backport/8427/stable26 branch August 18, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feature: signaling 📶 Internal and external signaling backends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant