Fix an occurence of null displayname issue #605
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
After having upgraded our Matrix client app to use matrix-ios-sdk v0.11.5, we noticed that some rooms happen to lose their display name and avatar on a seemingly random basis.
I can see from PR #599 that you are also facing similar issues.
From user feedbacks, it appears that Direct chats are the most affected.
I could reproduce this problem with the latest Riot iOS client, so I guess v0.11.6 does not fix that.
Steps to reproduce :
limited
sync)roomId
)What happens is that :
limited
sync of the chat.MXEventTimeline.handleJoinedRoomSync
, this limited sync triggers akMXRoomDidFlushDataNotification
notification.MXRoomSummary.resetRoomStateData
, which resets the chat avatar, displayname, topic and aliases, and tries to recompute them from state events.limited
sync data also contains a server room summary, then the displayname and avatar are restored soon after, inMXRoomSummary.handleJoinedRoomSync
I came up with the following workaround, which I submit to your approval : since the summary can't be recomputed from the state events, we can still reconstruct it by calling the standard Matrix name/avatar computation algorithm, via the update delegate's
session:updateRoomSummary:withServerRoomSummary:roomState:
method, passing it anil
server room summary.(A similar trick is already used to compute the room summary of invited rooms in
session:updateRoomSummary:withStateEvents:roomState:
)Not sure this fix is the most relevant (maybe this should be fixed on the server side after all, by sending the server room summary more often ?), but at least it can start a discussion ^^
Thank you !
Signed-off-by: Hervé Bérenger [email protected]