Skip to content

[Feature] Support delayed event delegation for legacy JWT request#3946

Merged
fkwp merged 3 commits into
livekitfrom
fkwp/feature_support_delegation_for_legacy_jwt_request
May 5, 2026
Merged

[Feature] Support delayed event delegation for legacy JWT request#3946
fkwp merged 3 commits into
livekitfrom
fkwp/feature_support_delegation_for_legacy_jwt_request

Conversation

@fkwp
Copy link
Copy Markdown
Contributor

@fkwp fkwp commented May 5, 2026

If, e.g., the homeserver is restarted due to k8s rescaling the CS API is offline for a short amount of time. If in this period an Element Call client disconnects (closing browser tab, network issues, etc.) the belonging MatrixRTC membership is not cleaned up. This resolves once the delayed event with the leave event is sent. Typically the delayed event timeout is in the order of 30-90 seconds, which is perceived as a long period of time.

This PR

  • adds the ability to add the delayed event delegation information also to the legacy JWT request, which reduces the emission of the delayed leave event to a minimum.
  • Increases the maximumNetworkErrorRetryCount to NOT fail during (the increased) timeouts.

Note: The deployed MatrixRTC stack requires a MatrixRTC Authorization Service (lk-jwt-service) to support the delegation feature, which is currently a PR.

@fkwp fkwp added the PR-Feature Release note category. A PR that introduces a new user facing feature. label May 5, 2026
@element-hq-sentry-production
Copy link
Copy Markdown

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/livekit/openIDSFU.ts

Function Unhandled Issue
getSFUConfigWithOpenID Error: Something went wrong /room/
Event Count: 1 Affected Users: 0
getSFUConfigWithOpenID Error: Etwas ist schief gelaufen /room/
Event Count: 1 Affected Users: 0

Did you find this useful? React with a 👍 or 👎

Copy link
Copy Markdown
Member

@BillCarsonFr BillCarsonFr left a comment

Choose a reason for hiding this comment

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

Looks like this is doing a bit more that delegation? The js-sdk thing about maximumNetworkErrorRetryCount?

@fkwp
Copy link
Copy Markdown
Contributor Author

fkwp commented May 5, 2026

Looks like this is doing a bit more that delegation? The js-sdk thing about maximumNetworkErrorRetryCount?

fair -- however, its very related.

@fkwp fkwp merged commit 147d0f9 into livekit May 5, 2026
37 checks passed
@element-hq-sentry-production
Copy link
Copy Markdown

element-hq-sentry-production Bot commented May 11, 2026

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

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

Labels

PR-Feature Release note category. A PR that introduces a new user facing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants