Skip to content
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

Support extensible events #393

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Support extensible events #393

wants to merge 2 commits into from

Conversation

Half-Shot
Copy link
Contributor

Closes #390

Matrix is moving to a new model for events where by messages no longer contain one representation, but a series of fallbacks (known as extensible events) so that applications can choose the best representation.

The bridge sdk will make use of the matrix-events-sdk to automatically parse and represent these events, and then use a new controller callback to emit these events. This is currently unstable, and so bridges need to explicitly opt in to this behavior to use it.

See https://github.com/matrix-org/matrix-events-sdk#readme
See matrix-org/matrix-spec-proposals#1767

@Half-Shot Half-Shot requested a review from a team February 16, 2022 12:59
@@ -33,8 +33,8 @@ export class RequestFactory {
* @param opts The options to pass to the Request constructor, if any.
* @return A new request object
*/
public newRequest<T>(opts?: RequestOpts<T>) {
const req = new Request(opts || {data: null});
public newRequest<T, R extends unknown>(opts?: RequestOpts<T>): Request<T, R> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: does R extends unknown do anything more than a regular R?

@tadzik
Copy link
Contributor

tadzik commented Feb 17, 2022

Looks good: do we have any bridge currently making use of this, so we can see how the API works out in practice?

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.

Emit extensible events via matrix-events-sdk
2 participants