Skip to content

Conversation

@Zil0
Copy link
Contributor

@Zil0 Zil0 commented Jun 12, 2018

I found a nice bug here https://github.com/matrix-org/matrix-python-sdk/blob/master/matrix_client/room.py#L87. It causes the _members list of User object to be overwritten, resulting in _members being a list of strings (the display names of the Users).

Obviously there are a lot of different way to fix this, I believe this one is the best but I'm open to suggestions.

Signed-off-by: Valentin Deniaud <valentin.deniaud@inpt.fr>

@non-Jedi
Copy link
Collaborator

Oh ya. That's definitely not good. I would say it's better to stick a copy() on the place where members are being accessed and mutated rather than in the getter methods since it's my intention for all getter/setter methods to be deprecated eventually.

Avoids overwriting the internal _members list with a list of
user_ids.
@Zil0
Copy link
Contributor Author

Zil0 commented Jun 12, 2018

Looking back at it this was even simpler to fix. Not sure why this line ended up doing things like that.

@non-Jedi
Copy link
Collaborator

This likely fixes #206. @Matrixcoffee, please let me know if you see that error again after this patch is merged.

@non-Jedi non-Jedi merged commit 1534f5a into matrix-org:master Jun 12, 2018
@ghost
Copy link

ghost commented Jul 3, 2018

This definitely looks like the cause of #206, so I'm going to assume it's fixed unless I see it again.

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