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

Handle failure to edit OT channel names #2500

Closed
sentry-io bot opened this issue Mar 31, 2023 · 8 comments
Closed

Handle failure to edit OT channel names #2500

sentry-io bot opened this issue Mar 31, 2023 · 8 comments
Labels
a: fun Related to non-serious, "fun" features (duck pond, off topic channel names) m: duplicate Issue or pull request already exists p: 2 - normal Normal Priority status: approved The issue has received a core developer's approval t: bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Mar 31, 2023

Sentry Issue: BOT-3F4

HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In name: Contains words not allowed for servers in Server Discovery.
  File "bot/exts/fun/off_topic_names.py", line 66, in update_names
    await channel_1.edit(name=OTN_FORMATTER.format(number=1, name=channel_1_name))

Unhandled exception in internal background task "update_names".

The blocked word was "swallow". I guess we should handle an excpetion here.

@mbaruh mbaruh added t: bug Something isn't working p: 2 - normal Normal Priority a: fun Related to non-serious, "fun" features (duck pond, off topic channel names) status: approved The issue has received a core developer's approval labels Mar 31, 2023
@TizzySaurus
Copy link
Contributor

TizzySaurus commented Mar 31, 2023

What do we actually want to happen when this occurs?

We can't prevent this from happening in the first place (the list of blocked words isn't public), so any action has to be reactive (i.e. try/except) as opposed to proactive (not allowing adding of the name to the pool).

I imagine a log.warn() stating that it attempted to rename but failed because the name "contains words not allowed for servers in Server Discovery", and then re-rolling would be sufficient?

I suppose the other issue is how we'd test the fix, since the error is only raised when inside a Discovery server.

@mbaruh
Copy link
Member

mbaruh commented Mar 31, 2023

All of that plus deactivating the blocked otn. You don't need the message since you have the status code

how we'd test the fix

We would artificially raise an exception (even with a temporary line inside the function)

@wookie184
Copy link
Contributor

There is previous discussion on this here: #2282

@TizzySaurus
Copy link
Contributor

@mbaruh

All of that plus deactivating the blocked otn.

Do you mean deleting the blocked otn? It seems people were broadly against that in #2282, but not sure if that still applies.

We would artificially raise an exception (even with a temporary line inside the function)

Right, yeah. Idk why I didn't think of that 😅

@wookie184
Copy link
Contributor

Deactivating a name sets a column in the database to indicate it as inactive, rather than fully removing it. Deactivated names can't be chosen as ot names. IIRC this feature was added to prevent a name being re-added if it was removed, and so it can still be looked at in the future if wanted (you can !otn list deactivated).

I'm not sure about a warning with log.warn, since it isn't something core devs can/should do anything about. I'd prefer a message in a mod channel somewhere (possibly mod-meta since it's pretty low volume and this shouldn't happen often, but any mod channel is fine by me).

@TizzySaurus
Copy link
Contributor

Deactivating a name sets a column in the database to indicate it as inactive, rather than fully removing it.

Ah, I see. That sounds good then, yes.

I'm not sure about a warning with log.warn, since it isn't something core devs can/should do anything about. I'd prefer a message in a mod channel somewhere

Makes sense, I think a message to mod-meta for good visibility works in-place of a log.warn (given, as you said, the low frequency of occurrences it will have).

Can I please be assigned to this, and I'll hopefully tackle it in the upcoming week.

@wookie184
Copy link
Contributor

Assigned 👍

@wookie184
Copy link
Contributor

Closing as a duplicate of #2282

@wookie184 wookie184 closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: fun Related to non-serious, "fun" features (duck pond, off topic channel names) m: duplicate Issue or pull request already exists p: 2 - normal Normal Priority status: approved The issue has received a core developer's approval t: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants