Skip to content

fix: ensure updated tokens get set on the regionUrlProvider#1900

Merged
lukasIO merged 5 commits intomainfrom
lukas/url-provider-token-refresh
Apr 21, 2026
Merged

fix: ensure updated tokens get set on the regionUrlProvider#1900
lukasIO merged 5 commits intomainfrom
lukas/url-provider-token-refresh

Conversation

@lukasIO
Copy link
Copy Markdown
Contributor

@lukasIO lukasIO commented Apr 20, 2026

and a small refactor to avoid the duplicate ownership of regionUrlProvider in both room and engine

closes #1849

@lukasIO lukasIO changed the title fix: ensure udpated tokens get set on the regionUrlProvider fix: ensure updated tokens get set on the regionUrlProvider Apr 20, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 20, 2026

🦋 Changeset detected

Latest commit: 1ae31ce

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lukasIO lukasIO requested a review from 1egoman April 20, 2026 09:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 96.33 KB (0%)
dist/livekit-client.umd.js 105.24 KB (0%)

Comment thread src/room/RTCEngine.ts
Comment on lines -1140 to -1144
if (this.token && this.regionUrlProvider) {
// token may have been refreshed, we do not want to recreate the regionUrlProvider
// since the current engine may have inherited a regional url
this.regionUrlProvider.updateToken(this.token);
}
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.

question: Should there also be a this.emit(EngineEvent.TokenRefreshed, token); here?

Copy link
Copy Markdown
Contributor Author

@lukasIO lukasIO Apr 21, 2026

Choose a reason for hiding this comment

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

good question. this should not be needed anymore as we're passing the token along at each token refreshed event, adding it nonetheless to ensure this isn't breaking any previous expectations.

@lukasIO lukasIO merged commit dd8c729 into main Apr 21, 2026
6 checks passed
@lukasIO lukasIO deleted the lukas/url-provider-token-refresh branch April 21, 2026 08:15
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
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.

Region refresh does not use updated token

2 participants