WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@dbkr
Copy link
Member

@dbkr dbkr commented Dec 11, 2025

It needs a network connection to do the init, so this would fail if a client tried to do it at startup with no internet, causing the token to just never be refreshed.

This just changes the API (compatibly) to do the init lazily.

The promise is kept is retain backwards compat, it can be removed later.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

It needs a network connection to do the init, so this would fail if
a client tried to do it at startup with no internet, causing the token
to just never be refreshed.

This just changes the API (compatibly) to do the init lazily.

The promise is kept is retain backwards compat, it can be removed
later.
@dbkr dbkr requested a review from a team as a code owner December 11, 2025 14:42
@dbkr dbkr added the T-Defect label Dec 11, 2025
dbkr added a commit to element-hq/element-web that referenced this pull request Dec 11, 2025
This was a bit odd where the function to create a refresher sometimes
created a refresher and sometimes just returned null, including if the
init failed, in which case you would just end up with no token refresher.

Pairs with matrix-org/matrix-js-sdk#5106 but
doesn't depend on either way.
Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

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

Looks sane

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants