Skip to content

OnGuildLeaveCloseThreadListener warnings on unknown threads #619

Closed

Description

@Zabuzard

Sometimes the OnGuildLeaveCloseThreadListener logs a warning that it can not find certain threads:

stacktrace

How is this possible? Were the threads deleted, by whom? Are they just closed/archived and JDA doesnt find them anymore? Why does this happen so often?

This is not supposed to happen, the reason should be found and then either fixed or this log has to be adjusted to debug level, if this is an expected event.

Activity

  1. added
    bug
    on Oct 8, 2022
  2. github-actions commented on Nov 8, 2022

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

  3. Zabuzard commented on Nov 8, 2022

    @Zabuzard
    MemberAuthor

    this issue is still there btw. happens frequently. probably an issue with archived threads that have to be retrieved first and are not in cache anymore or sth

  4. added
    valid
    and removed on Nov 9, 2022
  5. Taz03 commented on Dec 22, 2022

    @Taz03
    Contributor

    it is happening because rn it uses cache to get the threads

  6. Taz03 commented on Dec 22, 2022

    @Taz03
    Contributor

    fix is easy just use Guild#retrieveActiveThreads method to retrieve all active threads and then use ThreadChannel#getOwnerId method to get the creator id and match it with the user id from the member remove event.

    This wasn't possible before the forums channel update coz back then all threads were created by the bot and we needed a db to store who actually created the thread. But, it is not the case anymore so we can get rid of the db stuff in this command, and iirc the db was created for this specific feature so if it is not being used anywhere else we can get rid of that entire table.

  7. self-assigned this
    on Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority: normalvalid

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions