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
contact verification process triggered twice per each single QR scan #5379
Comments
This looks like you are running bot account on two devices. Are you logged into the same account on your desktop/phone as well? If this is the case, it is a duplicate of #5356. QR codes are synchronized between devices, this is why |
@link2xt there is not multi-device but thanks to your hint I realized the issue: since it is the bot policy to not keep user data, I am deleting messages immediately after they are sent, but this causes the secure-join message that was just sent to be deleted and then received again due to send-copy-to-self and triggers the qr scan twice small bot code reproducing the problem: # to run this first install: pip install -U deltabot-cli
from deltachat2 import EventType, MsgData, events
from deltabot_cli import BotCli
cli = BotCli("echobot")
@cli.on(events.RawEvent)
def log_event(bot, accid, event):
if event.kind == EventType.MSG_DELIVERED:
msg = bot.rpc.get_message(accid, event.msg_id)
bot.logger.info("deleting sent message: %s", msg.text)
bot.rpc.delete_messages(accid, [event.msg_id])
elif event.kind == EventType.SECUREJOIN_INVITER_PROGRESS:
if event.progress == 1000: # bot's QR scanned by an user
bot.logger.info("QR scanned, contact=%s", event.contact_id)
chatid = bot.rpc.create_chat_by_contact_id(accid, event.contact_id)
bot.rpc.send_msg(accid, chatid, MsgData(text="You scanned my QR"))
if __name__ == "__main__":
try:
cli.start()
except KeyboardInterrupt:
pass output after scanning the bot QR:
this is related to #3685 |
EDIT 2: actually bcc_self is enabled by default, and disabling it solves the issue, it is the docs at deltachat.h that are outdated:
|
for bots it is common to send an introduction or help message when users scan the bot contact QR or invitation link, the problem is that with latest core the secure-join protocol is triggered twice per QR scan and then the bot receives two
SECUREJOIN_INVITER_PROGRESS(progress==1000)
events per each single QR scanfirst time it says:
[03/26/24 09:27:00] DEBUG src/securejoin.rs:292: Received secure-join message "vc-request-with-auth".
second time it says:
[03/26/24 09:27:01] DEBUG src/securejoin.rs:570: Observing secure-join message "vc-contact-confirm".
The text was updated successfully, but these errors were encountered: