matrix-org / matrix-android-sdk

The Matrix SDK for Android - DEPRECATED
Apache License 2.0
370 stars 132 forks source link

Read receipts are not correctly updated in the room summary #527

Open devjeff opened 4 years ago

devjeff commented 4 years ago

I think, there is a bug in the method "org.matrix.androidsdk.data.Room#handleReceiptData"

The read receipt event id is only updated if the receiptData is created by my user. According to the comment in the method and my understanding this is wrong. The setReadReceiptEventId method should be called in the opposite case, i. e. when the receiptData is coming from a different user. Thus, the if statement:

if (isUpdated && TextUtils.equals(mMyUserId, receiptData.userId))

must be changed to:

if (isUpdated && !TextUtils.equals(mMyUserId, receiptData.userId))

AchrafAmil commented 4 years ago

Probably a sync issue. I had a similar problem with handleReceiptData crashing on sync read receipts data cast.

https://github.com/AchrafAmil/matrix-android-sdk/commit/e9e4a35846b997a2de46f09480ec27697a9cf070