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

Hide "X made no changes" event by default in timeline (#1430) #1436

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jun 2, 2020

Fixes #1430

Before PR:

image

After PR:

image

@bmarty bmarty requested a review from ganfra June 2, 2020 13:59
Copy link
Contributor

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Some remarks

@@ -38,6 +39,7 @@ internal object EventMapper {
eventEntity.content = ContentMapper.map(event.content)
val resolvedPrevContent = event.prevContent ?: event.unsignedData?.prevContent
eventEntity.prevContent = ContentMapper.map(resolvedPrevContent)
eventEntity.isUseless = event.type == EventType.STATE_ROOM_MEMBER && eventEntity.content == eventEntity.prevContent
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it should be saved in db?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's saved in DB to be able to do query on it. Maybe you known a better way to do query which check if two value in the DB are identical?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right, thanks to realm for not being flexible enough...
Could you create a class like IsUselessResolver to handle this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about it, but, it will call again what is called in the three line above, so for the perf, as we are inserting event in DB here, also from initial sync, I do not know if it's a good idea... What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok done, I let you check

@bmarty bmarty merged commit 617e945 into develop Jun 3, 2020
@bmarty bmarty deleted the feature/Fix_1430_X_made_no_change branch June 3, 2020 07:47
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.

X made no changes event in timeline
2 participants