Skip to content

Refactor thread model to be created from the root event #2142

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

Merged
merged 4 commits into from
Feb 1, 2022

Conversation

germain-gg
Copy link
Contributor

@germain-gg germain-gg commented Jan 28, 2022

To review alongside matrix-org/matrix-react-sdk#7670

  • Refactor thread model to be created from the root event
  • Integrate threads with the /relations API

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.

@germain-gg germain-gg requested a review from a team as a code owner January 28, 2022 16:40
} else {
this.root = event.getId();
if (this.hasServerSideSupport && this.initialEventsFetched) {
if (event.getTs() > this.lastReply().getTs() && !this.findEventById(event.getId())) {
Copy link
Member

Choose a reason for hiding this comment

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

relying on timestamps between events for ordering is a no-go given different servers will have different clocks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would be the alternative? How can I know whether a message is newly incoming?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm planning to merge this implementation using the age
It has cases in which is could cause the count to drift compared to the value returned by the HS. But this is never going to happen pre-release as we're going to use two homeservers with relatively synced clocks.
I'll create an issue to revisit that before the launch and will see whether we can find a better approach

@germain-gg germain-gg requested a review from t3chguy January 31, 2022 08:57
@germain-gg germain-gg merged commit 66b9884 into develop Feb 1, 2022
@germain-gg germain-gg deleted the gsouquet/threads-relations-19961 branch February 1, 2022 08:58
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