-
-
Notifications
You must be signed in to change notification settings - Fork 20
Add UPDATE_STATE widget api version #125
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
Add UPDATE_STATE widget api version #125
Conversation
861beca to
367f47c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/ClientWidgetApi.ts
Outdated
| */ | ||
| public async feedStateUpdate(rawEvent: IRoomEvent): Promise<void> { | ||
| if (rawEvent.state_key === undefined) throw new Error('Not a state event'); | ||
| const useUpdateState = (await this.getWidgetVersions()).includes(UnstableApiVersion.MSC2762_UPDATE_STATE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, this could be moved to line 1186 so that it won't be called unless needed. Then again, this will cache the result, so it shouldn't be expensive & should get called eventually.
|



Required for: matrix-org/matrix-js-sdk#4652 (this pr also provides more background on why this is needed)
Let the client only send UpdateState if the widget supports it.