-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for room peeking #141
Comments
Relevant hydrogen issue: element-hq/hydrogen-web#719 |
Update so far: Contribution to Hydrogen - ashfame/hydrogen-web@master...ashfame:hydrogen-web:guest_account In Chatrix: Draft PR I have added an unknown room view model and registers a guest account but at that point it fails to join the room. |
Quick update: I got the guest accounts functionality as I originally thought functional, but it was after joining the room with the guest account. Since, having lots of join notifications are undesirable, I was researching and was glad to learn that its certainly possible to preview room without joining the room. It just requires authentication and doesn't need to join the room. So that's what I have been working on. I am close, but I am stuck on rendering the timeline. View should re-render but it doesn't seem to. I also researched about utilising a single guest/limited user to preview users and that's a viable route as well, though it requires some additional steps. Its possible to set power level of this limited user as -1 in every room and thus it won't be able to post a message. But it would need to be in every room that we need the preview functionality for and have a negative power level (which is the additional step required with every room). Apart from that, I don't really see any other con with this approach. The only thing malicious a user can attempt to do with this, is to join other rooms on other servers and spam there. Those servers can choose to ban that user, which is the same concern with guest account as well. Unless we block such Client Server calls using Corporal or something. Additionally, we might have to lift rate limiting for this user in that case though. That being said, I would say, getting it first functional with guest account is the way to go. This way we have all the flexibility (someone can choose a guest account for room previews, someone can have the guest account ready for participation, and someone can designate a specific account for room previews). |
Quick update: I am currently working on bringing the peeking functionality in Hydrogen first, so that it works for all users i.e. regular and guest accounts. This prevents it from getting too complicated to work it all within Chatrix (its codebase, changes in node modules directly for hydrogen and rebuilding vite build files). I also lost some code modifications in node_modules when I picked it back after new year vacations. There are also multiple changes in hydrogen branches, which were merged in a single branch to act as the modified dependency. So working in hydrogen directly and landing it there is indeed a great way to move forward (thanks @psrpinto) and fact that upgrading hydrogen to the latest would simply bring the feature in, along with guest account functionality makes it a very viable route. Current work:
|
Quick update: @psrpinto and I were able to make progress on timeline by stuffing data directly in indexed db and that seems to change the view a little. I am going to continue to put more stuff in there and see if the timeline gets rendered that way. We also evaluated matrix-public-archive and that works by having the user (whose access token it uses) to be joined to the room. We also discussed options of bringing peeking functionality since we both find it quite valuable and decided that continuing on current path of landing peeking support in hydrogen is indeed the best path forward. My hope is that, with more stuff put into indexed db, we would atleast see the timeline rendered properly and it would just be the sync that we would need to write some code for, to keep showing new messages as they come into the room. |
Great, thanks for the update! |
Quick update: Finally got the timeline to render during today's pairing session with @psrpinto Things that are yet to do:
|
Draft PR link for review - Automattic/hydrogen-web#2 |
Yes, I think this is not urgent and I am not sure it is actually implemented even in Element itself. |
I agree that having new messages come in after the timeline is loaded is something we could look at in the future, once/if "static" peaking gets merged into hydrogen. |
Yep, agree sync can come later on. For sake of documentation, Element does support it. I have made the following changes:
What still needs doing:
|
Got a bunch of more things done today:
Couple of things that I would say are remaining:
|
Draft PR for Hydrogen - Automattic/hydrogen-web#3 Members identity are shown instead of names. Apparently loading members list brings in more undesirable effects so that has been left for later. Peeking is functional! 🥳 Getting it reviewed internally before submitting it to upstream. |
Updated original comment with upstream PR link and next step to follow. |
Grand update:In order to have peeking support in Chatrix, there are 2 user stories to satisfy. User Story 1I am already a logged in user on Matrix homeserver and I am browsing different pages where different rooms are embedded. On one of those page, I can land on a room that I haven't joined. But if that room is world readable, I can just peek into it, using my existing account. This user story is satisfied by the upstream PR for peeking, which is about just using an existing session to peek into an unknown room if its world readable. The bottom bar only has "Join Room" option. User Story 2I am not logged in on Matrix homeserver at all and I am browsing pages where a matrix room is embedded. If any of the rooms are world readable, I should still be able to peek into the room, by having a guest account created for myself behind the scenes. This user story would be satisfied once upstream PR for peeking is merged and another PR for creating a guest account when trying to render Chatrix in single room mode which would work as following:
So, the user experience is similar to User Story 1, with just the difference between the options shown in bottom bar for participation. It could just be "Login" option for now, but eventually someone can want guest user participation as well (joining room as guest user and send messages in the room)? Existing work for User story 2Work in following 2 links would need to be adapted on top of our upstream peeking PR:
I tried running peeking PR branch as Hydrogen dependency in Chatrix, to prepare how this second PR would look like but there are some issues that we first need to resolve prior to update our dependency to Hydrogen version PSOnce we attempt to package "Guest as login" proposal to Hydrogen as whole, some of the specific code for user story 2, sitting just in Chatrix could potentially be contributed upstream. Not all of it would be possible, since "Single Room Mode" is a Chatrix's concept. |
First comment of issue updated with links to relevant PRs to finish this feature. |
Done via #199 |
It'd be interesting for people not having to join the chat room to see the ongoing conversation. Since Matrix has support for peeking into a room, let's research how we can implement this, ideally completely anonymous, so that only when people want to write a message, they'd log in.
The text was updated successfully, but these errors were encountered: