Skip to content

Conversation

@toger5
Copy link
Contributor

@toger5 toger5 commented Jan 23, 2025

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.

@toger5 toger5 changed the base branch from toger5/backwards-compatibility-for-UpdateState to master January 23, 2025 17:11
@toger5 toger5 force-pushed the toger5/backwards-compatibility-for-Update-State-no-perttier branch from 861beca to 367f47c Compare January 23, 2025 17:26
Copy link
Member

@AndrewFerr AndrewFerr left a comment

Choose a reason for hiding this comment

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

LGTM

*/
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);
Copy link
Member

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.

@sonarqubecloud
Copy link

@toger5 toger5 merged commit 8a98718 into master Jan 24, 2025
4 checks passed
@toger5 toger5 deleted the toger5/backwards-compatibility-for-Update-State-no-perttier branch January 24, 2025 08:35
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.

3 participants