-
Notifications
You must be signed in to change notification settings - Fork 21
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
Chatterbox registers two accounts when first opened, then crashes #105
Chatterbox registers two accounts when first opened, then crashes #105
Comments
Same exact issue test on both same server and remote. |
I noticed that in the chatterbox/src/viewmodels/ChatterboxViewModel.ts Lines 100 to 107 in 86bc290
createRoomWithUserSpecifiedInConfig() , but the 'join' step just returns an M_FORBIDDEN 'You are not invited to this room.' error - even though (or perhaps because) it's already in (and an admin of) that room. If I skip that and just do the _waitForRoomFromSync part, it ends up waiting forever - the room never appears in the map.
If I look at the room from the account that's receiving the invitation, I can see that the Chatterbox user is still a member/admin of the room. |
Upon further investigation, it seems Chatterbox is actually registering two accounts the first time it opens, creating or joining the room from the first one, then failing to find the room. This happens whether I'm using At the point where CB tries to look up the room object in the map, the session object being used appears to correspond to the second account (according to its (In |
room is undefined
error the first time a user opens Chatterbox in invite_user
mode
Could a possible hack be to alter line 114? |
I just tried that patch, but it still fails the same way on the first page load, and only starts working after a reload. The only difference is that when it starts working, it's using the first of the two accounts - the one that already sent an invitation. That line seems to be in the code that attempts to restore an existing session. The problem I'm seeing is happening when that function has decided there is no existing session, and a new account needs to be created. Somehow, the I noticed that the ( |
Make sure AccountSetupViewModel is only created once Fixes element-hq#105.
Describe the bug
I'm trying to set up a self-hosted instance of Chatterbox in
invite_user
mode. When I first click on the Chatterbox button, it starts to open, creates the room, and sends the invitation, but then gets an error saying thatroom is undefined
(t is undefined
in the built version) and removes itself from the page. If I then reload the page and open Chatterbox again, it creates a second room, sends an invitation to that room, and works correctly from that point on. If I simulate being a new user (by clearing site data, opening a private window, or using a different browser), it fails again, then starts working again after a reload.The error seems to be happening in Hydrogen's
RoomViewModel
class here, but that seems to be a result of Chatterbox passing inundefined
as theroom
. I've managed to trace the problem to this part ofcreateRoomWithUserSpecifiedInConfig
:chatterbox/src/viewmodels/ChatterboxViewModel.ts
Lines 78 to 95 in 86bc290
this._sessions.rooms
map is completely empty.To Reproduce
Steps to reproduce the behavior:
homeserver
andtoken
settings. Replace theauto_join_room
setting withinvite_user
, and set it to a Matrix user ID that you control.iframe
, and won't let you look at the code that's failing anymore. To prevent this, addHTMLIFrameElement.prototype.remove = function() { console.log('refusing to remove iframe', this); };
after theCHATTERBOX_CONFIG_LOCATION
line.chatterbox-v0.5.2
folder to a web server, or serve it onlocalhost
using something likehttplz
.OR
git clone https://github.com/element-hq/chatterbox; cd chatterbox
homeserver
andtoken
settings. Replace theauto_join_room
setting withinvite_user
, and set it to a Matrix user ID that you control.yarn install
yarn start
Expected behavior
Chatterbox should remain open after creating the room even if the user is opening it for the first time.
Screenshots
N/A. There's not really anything to take a screenshot of once Chatterbox removes itself.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Not tested yet.
Device: [e.g. iPhone6]OS: [e.g. iOS8.1]Browser [e.g. stock browser, safari]Version [e.g. 22]Additional context
I was originally testing with Chatterbox running on
http://localhost:8000
, but I've also tried running it from a realhttps://
site, and am getting the same results there. I'm running Chatterbox v0.5.2 (or 86bc290 when trying the dev build, but the only changes since v0.5.2 seem to be in the readme).I have it set to use a self-hosted Synapse homeserver. When I first noticed the issue,
invite_user
was set to a user on a different self-hosted Synapse, but it seems to happen even if theinvite_user
is on the same server.The text was updated successfully, but these errors were encountered: