Skip to content

Conversation

@psrpinto
Copy link
Member

@psrpinto psrpinto commented Jun 1, 2023

Fixes #211

This PR fixes several issues with single-room mode and guest login.

Previously we were disabling hydrogen's feature of restoring the last URL, but this breaks hydrogen in subtle ways. So we're no longer doing that globally, instead we only do it for the cases where it makes sense (login and "empty" session picker).

Additionally, we were re-implementing functionality that is already in hydrogen, related to showing the unknown room and checking if it's world-readable. In chatrix we don't need to do this, we just need to login as guest when appropriate, and send the user to the room.

The code that manages which screen is shown under which conditions is hard to understand IMHO (hydrogen is missing a proper "router"), so I refactored it a bit and added a bunch of comments.

I tested this in all the ways I could think of and did not find any issues. However, there are unrelated issues that can look like it's an issue with this PR (#224 and #225) so take that in mind if you do testing on your side.

TODO

  • When there's a single session in the session picker, and we're in single-room mode, it doesn't go directly into that session, and instead shows the session picker

@psrpinto psrpinto force-pushed the single-room-fixes branch from 2ed7a67 to 2430728 Compare June 2, 2023 15:14
@psrpinto psrpinto force-pushed the single-room-fixes branch from 246a877 to 1ea96eb Compare June 2, 2023 16:15
@psrpinto psrpinto marked this pull request as ready for review June 5, 2023 16:49
@psrpinto psrpinto requested a review from ashfame June 5, 2023 16:49
@psrpinto
Copy link
Member Author

psrpinto commented Jun 6, 2023

Partially reviewed with @ashfame on a call, merging so we can ship the fixes for guest login.

@psrpinto psrpinto merged commit e0ea956 into main Jun 6, 2023
@psrpinto psrpinto deleted the single-room-fixes branch June 6, 2023 14:23
@psrpinto psrpinto mentioned this pull request Jun 6, 2023
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.

Handle failure in guest registration

2 participants