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

More robust forum webhook handling required #608

Open
FreneticScribbler opened this issue Nov 6, 2024 · 5 comments
Open

More robust forum webhook handling required #608

FreneticScribbler opened this issue Nov 6, 2024 · 5 comments
Labels

Comments

@FreneticScribbler
Copy link
Member

So - I guess I made an assumption that nobody would remove the rig number from the automatically generated title from the 'add forum thread' button.

Clearly, I should never have relied on that assumption... Need to insert a hidden field with it in, or something (though I suppose this would still be user over writable). At the very least the code needs to more gracefully abort...

event_id = int(body['topic']['title'][1:6]) # find the ID, force convert it to an int to eliminate leading zeros

Whoops.

@jb3
Copy link
Member

jb3 commented Nov 7, 2024

Can we just regex for an event identifier in the title and do it that way?

I don't think we need to do much else smart, people can manually add a forum thread when editing the rig, if we want to we could search new post bodies for RIGS embeds?

Agree that it should gracefully handle.

This issue is manifesting as RIGS-29 in Sentry for those with access.

@FreneticScribbler
Copy link
Member Author

Basing it on the embed would be better as people are much better trained to include that than to follow the sort-of-standardised 'rig number | rig title' format.

@jerbzz
Copy link
Contributor

jerbzz commented Nov 7, 2024

How would we deal with the case of multiple embeds of the same rig?

@jb3
Copy link
Member

jb3 commented Nov 7, 2024

I think only adding a URL in if there is not already a URL is probably the safest way to do it.

We can also constrain by forum area etc. and also only look at top level posts?

@FreneticScribbler
Copy link
Member Author

Pretty sure I already setup the webhook to only fire on top level posts in #rig-info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants