core icon indicating copy to clipboard operation
core copied to clipboard

bot receiving contact request for groups if no 1:1 chat exist yet

Open adbenitez opened this issue 1 year ago • 1 comments

it seems there is a regression in core 1.137.4, if you create a group with a bot you have not contacted in 1:1 first, the group appears as a contact request for the bot, and sending messages fails, instead of the chat being auto-accepted for example:

May 01 11:53:53 bomba invitebot[1104567]: 2024-05-01T11:53:53Z ERROR [-1] cannot send to Chat#229: contact request chat should be accepted before sending messages {"acc": 2, "chat": 229}
May 01 11:53:53 bomba invitebot[1104567]: main.sendInviteQr                                                                                                                                                       
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/work/invitebot/invitebot/invitebot.go:137                                                                                                          
May 01 11:53:53 bomba invitebot[1104567]: main.onNewMsg                                                                                                                                                           
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/work/invitebot/invitebot/invitebot.go:76                                                                                                           
May 01 11:53:53 bomba invitebot[1104567]: github.com/deltachat/deltachat-rpc-client-go/deltachat.(*Bot).processMessages                                                                         
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/go/pkg/mod/github.com/deltachat/[email protected]/deltachat/bot.go:176                                    
May 01 11:53:53 bomba invitebot[1104567]: github.com/deltachat/deltachat-rpc-client-go/deltachat.(*Bot).Run                                                                               
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/go/pkg/mod/github.com/deltachat/[email protected]/deltachat/bot.go:136
May 01 11:53:53 bomba invitebot[1104567]: github.com/deltachat-bot/deltabot-cli-go/botcli.serveCallback
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/go/pkg/mod/github.com/deltachat-bot/[email protected]/botcli/cmd.go:193
May 01 11:53:53 bomba invitebot[1104567]: github.com/deltachat-bot/deltabot-cli-go/botcli.(*BotCli).Start 
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/go/pkg/mod/github.com/deltachat-bot/[email protected]/botcli/botcli.go:102
May 01 11:53:53 bomba invitebot[1104567]: main.main
May 01 11:53:53 bomba invitebot[1104567]:         /home/runner/work/invitebot/invitebot/invitebot.go:143
May 01 11:53:53 bomba invitebot[1104567]: runtime.main
May 01 11:53:53 bomba invitebot[1104567]:         /opt/hostedtoolcache/go/1.21.6/x64/src/runtime/proc.go:267

related: https://github.com/deltachat/deltachat-core-rust/pull/4377

adbenitez avatar May 01 '24 12:05 adbenitez

Apparently this line is the problem: https://github.com/deltachat/deltachat-core-rust/blob/38a2e07194a2e439cd79c05846ccb050825b5431/src/receive_imf.rs#L801-L804 Should be create_blocked_default instead. But i haven't yet understood what happens. Do you create a verified group with the bot? (e.g. after scanning its QR) Otherwise there's test_auto_accept_group_for_bots() which tests the scenario for unverified groups.

iequidoo avatar May 02 '24 07:05 iequidoo