martin
(Martin Brennan)
February 25, 2025, 3:09am
19
I’ve merged a fix for that now:
main
← fix/oneboxer-cache-discobot
opened 04:10AM - 24 Feb 25 UTC
This issue was found via Discobot. In part of the tutorial
for Discobot, it ask… s for a URL on one line so it can demonstrate
how oneboxes work.
The way it does this when the user replies is to cook the
post raw and check if there is a cached onebox for the URL
in the post. However, if you reply really fast to Discobot
with the URL without waiting for the onebox to appear in the
composer preview, it's not cached by the time we do this
check in the Discobot code.
This commit fixes the issue by following a more simplified
approach, where we check for the existence of one of the
following links from the onebox instructions:
```
https://en.wikipedia.org/wiki/Inherently_funny_word
https://en.wikipedia.org/wiki/Death_by_coconut
https://en.wikipedia.org/wiki/Calculator_spelling
```

This will fall down if someone customizes the onebox
step text, or if the user uses a different link instead,
but we are willing to accept that risk at this time to simplify things.
The problem happened when responding with the link before our composer preview could onebox the link. Now we do a much simpler check for the example links when doing this step.
3 Likes