martin
(Martin Brennan)
25. Februar 2025 um 03:09
19
Ich habe das Problem jetzt behoben:
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.
Das Problem trat auf, als wir mit dem Link geantwortet haben, bevor unsere Composer-Vorschau den Link als Onebox darstellen konnte. Jetzt führen wir eine viel einfachere Prüfung für die Beispiel-Links durch, wenn wir diesen Schritt ausführen.
3 „Gefällt mir“