Company
Date Published
Author
Preston Pham, Cyrus Roshan
Word count
893
Language
English
Hacker News points
1

Summary

We built Jam to help users file bugs, but we're not perfect. A bug affected some users during their first Jam install, where clicking on the extension's UI wouldn't register. The buggy code had been unchanged for four months and was refactored to only initialize the main React store if a user was authenticated. However, this change led to a complex issue with the `monkeyPatchDocument` function, which was designed to be safe but ended up appending the entire previous fake document into the new one, causing the bug. Debugging involved tracing the code, examining the DOM, and verifying each function worked as expected, ultimately fixing the double rendering of the React root element. The takeaway is that bugs will happen, but giving engineers data to perform debugging matters even more, and tools like Jam can help quickly file bugs with network requests, console logs, and session replays.