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

Writing for the first time in your session in a room can throw an error #288

Closed
bwindels opened this issue Mar 22, 2021 · 2 comments · Fixed by #320
Closed

Writing for the first time in your session in a room can throw an error #288

bwindels opened this issue Mar 22, 2021 · 2 comments · Fixed by #320
Labels
bug Something isn't working

Comments

@bwindels
Copy link
Contributor

bwindels commented Mar 22, 2021

When none of your syncs so far contained your own member event for a room (because of lazy loading), fetching it when you open the timeline will create a RoomMember object with null for data, which throws an error when calling PendingEventEntry.sender.

We should probably fall back to your userId and once you write it will get updated.

@bwindels bwindels added the bug Something isn't working label Mar 22, 2021
@bwindels bwindels changed the title Writing for the first time in a room can throw an error Writing for the first time in your session in a room can throw an error Mar 22, 2021
@bwindels
Copy link
Contributor Author

bwindels commented Apr 8, 2021

I think this was likely in part caused by the same issue that caused #271, e.g. the member not being written because it was already added to the cache by lookupMember. We should still fall back to the user id though.

@bwindels
Copy link
Contributor Author

bwindels commented Apr 8, 2021

I made a fix at https://github.com/vector-im/hydrogen-web/commits/bwindels/fetch-member-on-first-msg before realizing #271 is likely the root cause. I think that fix adds a bit too much fluff for something that doesn't really happen in practice, so I will go with just fall back to the user id. If we then in practice see the first message being locally echod with just the user id, we know the more involved fix is needed, but I doubt it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant