Vint.ee threw away jQuery. And of course, it led to a major incident.

被17名用户阅读

MeikopVint.ee创建者 2025-08-28T18:36:30+03:00
Hello,

jQuery is a timeless JavaScript library that we've been using since the beginning of time.
I've been planning to get rid of it and use pure JavaScript (VanillaJS) for a long time. The amount of work was quite decent (it could be measured in days) because jQuery was used on at least 30 pages. So it never got enough priority.

Yesterday I thought I would experiment with some AI tools and started using Github Copilot Agent mode. And I set out to get rid of jQuery. To my surprise, the AI agent was surprisingly good at generating code that would replace jQuery code.

The entire job was done in three hours instead of days!

The story could have ended happily at this point... but no!
After the changes were posted last night, today I started getting emails saying I can no longer log in to the game! So it's a pretty critical incident.

Yes, jQuery was also used during login, so the login issues were obviously related to my changes.
And of course, everything works for me. Of course, the immediate thought is that people are using some weird browsers (like MS Edge ;)), but when one user claimed to have Google Chrome, things got more suspicious.

Javascript is located in a separate file (general.js) that browsers may cache. The solution is ctrl F5 - the browser loads new files instead of using the ones in its memory.
But that didn't work for some users either!

And then I finally remembered that we use Cloudflare , which eagerly caches all the files and then serves them!
I just purged Cloudflare's cache for this file.

And just before I posted this, I received a call that brought up one more aspect. Namely, logging in from the game room wasn't working. Everything worked on the home page.

I started investigating the matter (fortunately, this problem was reproduced in the development environment) and it turned out that AI had generated a window.onload function in all files. But there can't be multiple of these functions on one page! I had to unpack 30 files again and use the window.addEventListener("load", function() {}); function.

It happens to the maker.

poffic 2025-08-29T20:50:26+03:00
sounds like rocket science to someone who is afraid of flying

发表回复

这个功能只针对已验证的或VIP用户