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

Make local echo work for threads #2026

Merged
merged 9 commits into from
Nov 24, 2021
Merged

Conversation

germain-gg
Copy link
Contributor

@germain-gg germain-gg commented Nov 18, 2021

Related to element-hq/element-web#19616

  • Use PendingEventOrdering enum rather than hardcoded values
  • Make local echo work for threads

This PR currently has no changelog labels, so will not be included in changelogs.

Add one of: T-Deprecation, T-Enhancement, T-Defect, T-Task to indicate what type of change this is plus X-Breaking-Change if it's a breaking change.

src/client.ts Outdated
): Promise<ISendEventResponse> {
return this.sendCompleteEvent(roomId, { type: eventType, content }, txnId, callback);
if (!threadId?.startsWith("$") && threadId !== null) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm really not a fan of string matching these things - can we pass an object of some kind for instanceof checks instead? The types will be a lot easier to work with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They could be, but the reason why I opted out from that was to keep it simple to send an event.
Not requiring a developer to instanciate 5 different models before they can even send something

The way the app is architectured too, the composer is not really aware of the Thread model either, but is aware of a relation to attach to all event it emits out.
I decided to go with that solution to keep the door open to more changes in the future and not tie down the composer to the current model of threads

@germain-gg germain-gg requested a review from turt2live November 23, 2021 08:24
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

Thanks! This is a lot more comfortable feeling :)

@germain-gg germain-gg merged commit ddd6a05 into develop Nov 24, 2021
@germain-gg germain-gg deleted the gsouquet/local-echo-19616 branch November 24, 2021 08:19
skyka13711 pushed a commit to 42-px/matrix-js-sdk that referenced this pull request Apr 14, 2022
skyka13711 pushed a commit to 42-px/matrix-js-sdk that referenced this pull request Apr 14, 2022
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.

2 participants