镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[BUG]: Confirm thread creation with react to contact causes bot to soft-block users with disabled DMs #3442

Description

@Taaku18

Bot Version

4.2.1

How are you hosting Modmail?

Other

Error Logs

n/a

Screenshots

No response

Additional Information

Prerequisite:

React to contact message+emoji set and confirm thread creation set.

When the user has their privacy settings turned off (disallow DMs), the user clicks the react to contact emoji, the bot tries to send the confirm thread creation message to the user, the user's ticket is now stuck in a "limbo" state (stored in cache as "not ready"). A bot restart is required to clear the cache, even if the user allows DMs in settings.

Symptoms:

Spammed logs of thread setup timed out, 25s delay in responses

core.thread[53] - WARNING: Waiting for thread setup timed out.

When using the ?contact command on a soft-blocked user, bot responds with "Thread not created / A thread for [...] already exists".

Note: these symptoms may be caused by other unrelated bugs as well.

Activity

  1. added theissue type on May 29, 2026
  2. 13-Prabhat commented on Jun 18, 2026

    @13-Prabhat

    Hi @Taaku18, I'd like to work on this.
    I traced it to core/thread.py in ThreadManager.create() — the destination.send(...) call for the confirm-thread-creation prompt isn't wrapped in a try/except. When the recipient has DMs disabled, this raises discord.Forbidden uncaught, so view.wait() never runs and the thread stays in cache in a "not ready" state, matching the symptoms in the issue (timeout warnings, stuck contact command).
    Fix: catch discord.Forbidden around that send, mark the thread cancelled, and clear the cache entry immediately. Will open a PR shortly.

  3. martinbndr commented on Jun 18, 2026

    @martinbndr
    Contributor

    Sure @13-Prabhat feel free to create a pr, then we will review and test your changes. Keep in mind to target the dev branch and also create your branch based of development just to avoid issues.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis is a confirmed bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions