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

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

Open
adbenitez opened this issue May 1, 2024 · 1 comment
Open
Labels
bot bug Something is not working

Comments

@adbenitez
Copy link
Member

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/deltachat-rpc-client-go@v1.134.0/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/deltachat-rpc-client-go@v1.134.0/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/deltabot-cli-go@v0.6.1-0.20240206182306-1262a8de3fc0/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/deltabot-cli-go@v0.6.1-0.20240206182306-1262a8de3fc0/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: #4377

@adbenitez adbenitez added bug Something is not working bot labels May 1, 2024
@iequidoo
Copy link
Collaborator

iequidoo commented May 2, 2024

Apparently this line is the problem:

// 1:1 chat is blocked, but the contact is not.
// This happens when 1:1 chat is hidden
// during scanning of a group invitation code.
Blocked::Request

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants