wikispeedruns / wikipedia-speedruns

Source code for Wikipedia Speedruns!
https://wikispeedruns.com
MIT License
100 stars 30 forks source link

Fix for link handling bug #502

Closed dqian3 closed 1 year ago

dqian3 commented 1 year ago

We've been getting reports of people clicking on links in the middle of their run and it taking them to a bad page (i.e. actually following the link /wiki/... instead of going into our handling code).

We think the reason for this is that in cases where our articleRenderer throws an error, it would fall into a backup case, which wasn't written correctly and wouldn't call e.preventDefault(). To solve this, I put that all the link handler code in a finally block. it's crude, but should prevent the bug temporarily.