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

Inviting a non-contact matrix puppet of whatsApp user to a new room don't work as expected #284

Open
wlongo opened this issue Mar 10, 2021 · 1 comment · May be fixed by #523
Open

Inviting a non-contact matrix puppet of whatsApp user to a new room don't work as expected #284

wlongo opened this issue Mar 10, 2021 · 1 comment · May be fixed by #523

Comments

@wlongo
Copy link

wlongo commented Mar 10, 2021

When i tried to invite the matrix puppet of a whatsapp contact to a room ( @whatsapp_xxxxxxxxxxxx:matrix-home-server.org ) , the puppet didn't get properly invited.

Some context for this behavior:

  1. the contact was completely new to the whatsapp bridge and was not on the phone's contact list.
    2.the contact was not on matrix as well.
  2. If i use the !wa pm --force ... phone_number to initiate the chat, everything works as expected.

I investigated the issue here and i found out that this was because the bridge bot was silently receiving the error
"SynapseError: 403 - Application service has not registered this user" and thus, aborting the process of creating the private portal.

I located the issue on the HandlePuppetInvite handler when it was checking the members of the room ( method joinAndCheckMembers () ). I suppose since the puppet was recently created, it was not yet registered on matrix.

I don't know if this was an intentional behavior, but i patched the code and now it's working perfectly.

If you think it's valid to provide a PR, let me know !

@ptimatth
Copy link

ptimatth commented Mar 29, 2023

I think i have an equivalent issue but in the other way.

An unknown contact send me a message on WA and the bridge has crashed after create the room and invite me in.

Mar 29, 2023 13:51:49 WRN Failed to insert IMMEDIATE/336XXXXXXXX@s.whatsapp.net with priority 0: pq: null value in column "queue_id" of relation "backfill_queue" violates not-null constraint module=Database/Backfillpanic:
runtime error: invalid memory address or nil pointer dereference[signal SIGSEGV: segmentation violation code=0x1 addr=0x0
 pc=0x575901]

goroutine 53278 [running]:
database/sql.(*Rows).close(0x0, {0x0, 0x0})
        /usr/local/go/src/database/sql/sql.go:3274 +0xa1database/sql.(*Rows).Close
(0x40ea2b?)
        /usr/local/go/src/database/sql/sql.go:3270 +0x1d
maunium.net/go/mautrix/util/dbutil.(*LoggingRows).Close(0xc000470e00)   /builds/mautrix/whatsapp/.cache/pkg/mod/maunium.net/go/mautrix@v0.15.0/util/dbutil/connlog.go:129 +0x2a

maunium.net/go/mautrix-whatsapp/database.(*Backfill).Insert(0xc000803d80)
        /builds/mautrix/whatsapp/database/backfill.go:230 +0x5ca
main.(*User).EnqueueImmediateBackfills(0xc0003887e0, {0xc0006f7990, 0x1, 0x116434a?})
/builds/mautrix/whatsapp/historysync.go:514 +0x4dmain.(*Portal).CreateMatrixRoom(0xc000786880, 0xc0003887e0
, 0x0, 0x0, 0x1)
        /builds/mautrix/whatsapp/portal.go:1750 +0x2529main.(*Portal).handleMessageLoopItem(0xc000786880
, {0xc000460b40, 0x0, 0x0, 0x0, 0xc0003887e0})  /builds/mautrix/whatsapp/portal.go:302 +
0x145
main.(*Portal).handleMessageLoop(0xc000786880)
        /builds/mautrix/whatsapp/portal.go:391 +0x1cd
created by main.(*WABridge).newBlankPortal
        /builds/mautrix/whatsapp/portal.go:203 +0x238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants