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

[BUG] Manual deletion of channel prevents tickets from closing. #276

Closed
missionz3r0 opened this issue Mar 11, 2022 · 2 comments
Closed

[BUG] Manual deletion of channel prevents tickets from closing. #276

missionz3r0 opened this issue Mar 11, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@missionz3r0
Copy link

missionz3r0 commented Mar 11, 2022

Describe the bug

If someone manually deletes a ticket's channel, you can not close the ticket associated with that channel. This leaves the user unable to create a new ticket since they can't close their old one.

Additionally, it requires DB writes and a server restart to clear out the the ticket.

To reproduce

  1. Create new category
  2. Create new button panel for created category
  3. Create a ticket using the button panel.
  4. Delete the created channel.
  5. Attempt to close ticket. Either time, or by id. Doesn't matter.

Expected behaviour
The ticket is able to be closed despite the state of discord. If a channel or category doesn't exist anymore, the ticket should still close.

Screenshots
image

Additional Context

10.03 19:10:18 [Bot] 2022-03-11 00:10:18 [INFO] (COMMANDS) Executing "close" command (invoked by missionz3r0#____)
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [NOTICE] PLEASE INCLUDE THIS INFORMATION IF YOU ASK FOR HELP ABOUT THE FOLLOWING ERROR:
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [NOTICE] Discord Tickets v3.1.2, Node v16.7.0 on linux
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [] An error was not caught
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [] Uncaught Error
10.03 19:10:21 [Bot] 2022-03-11 00:10:21 [ERROR] Error: A ticket with the ID or number "951633061571866634" could not be resolved
10.03 19:10:21 [Bot] at TicketManager.close (/src/modules/tickets/manager.js:231:21)
10.03 19:10:21 [Bot] at runMicrotasks (<anonymous>)
10.03 19:10:21 [Bot] at processTicksAndRejections (node:internal/process/task_queues:96:5)
10.03 19:10:21 [Bot] at async InteractionCollector.<anonymous> (/src/commands/close.js:275:6)
@missionz3r0 missionz3r0 added the bug Something isn't working label Mar 11, 2022
@n1kkl
Copy link
Contributor

n1kkl commented Jun 24, 2022

I think it'd make more sense to just close the ticket if the channel is deleted. There is no point in having a ticket without channel.

@RooRay
Copy link
Contributor

RooRay commented Jun 26, 2022

I think it'd make more sense to just close the ticket if the channel is deleted. There is no point in having a ticket without channel.

this, unless the bot makes a new channel when it detects the channel is deleted but just deleting the ticket would likely be more practical

edit: apparently I forgot how githubs reply system works

maeldebon pushed a commit to Erisium-Community/eri-ticketbot that referenced this issue Apr 6, 2023
- change close function on manager so tickets without channel can be closed
- create an event listener to close tickets when someone deletes a channel
Note: The ticket will be closed when someone deletes the channel,
but it is supposed to be a fallback. Pinned messages will
not be stored.

Fixes discord-tickets#276
maeldebon added a commit to Erisium-Community/eri-ticketbot that referenced this issue Apr 6, 2023
* fix(channels): close ticket when the channel is deleted

- change close function on manager so tickets without channel can be closed
- create an event listener to close tickets when someone deletes a channel
Note: The ticket will be closed when someone deletes the channel,
but it is supposed to be a fallback. Pinned messages will
not be stored.

Fixes discord-tickets#276

* docs: add @n1kkl as a contributor

* docs: add FoxXxHater as a contributor for platform (discord-tickets#368)

* docs: update CONTRIBUTORS.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* refactor(docker): Rewrite Dockerfile

- Image comes in at around 203 MB now

* feat(docker): Add compose config

* docs: add AdminRAT as a contributor for platform (discord-tickets#370)

* docs: update CONTRIBUTORS.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* docs: add c43721 as a contributor for platform (discord-tickets#371)

* docs: update CONTRIBUTORS.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Isaac <git@eartharoid.me>

* docs: add c43721 as a contributor for doc (discord-tickets#373)

* docs: update CONTRIBUTORS.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* Update CONTRIBUTORS.md

* Update SECURITY.md

* docs: update CONTRIBUTORS.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* docs: update contributors list

* fix: update to`discord.js@13.14.0`

* Increase channel delete delay

---------

Co-authored-by: Nikkl <niklas@nikkl.me>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: AdminRAT <24538037+AdminRAT@users.noreply.github.com>
Co-authored-by: Isaac <git@eartharoid.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Complete
Development

No branches or pull requests

3 participants