Context
After pushing through Dub restructure last week, there’s a lot of cleanup work to be done!
Outside of supporting Cam in building out the new profile/space centric interface for Dub, part of my job is finalizing all the details around making sure we gracefully handle errors - i.e., don’t crash when things go wrong & keep the user in the loop.
Overview
The big push this week was an error API - a universal online server to track and anonymously store all the errors in Dub - both while we’re testing and when we’ve launched.
Internally, this service could help us track and trace down where crashes are coming from and how they originate on our beta builds.
But, more importantly: Out in the world, we need a good way to cache, secure, and repair bug reports from Dub from our users anonymously.
There are two primary goals here:
- Anonymously capture and track user errors
- Keep the app from crashing and preserve the last user state (fail gracefully)
Process
Currently, if something goes wrong, the app just “returns” - i.e, nothing happens with that specific action.
This can either lead to 1) nothing happening when I clicked a button or 2) the app just out right crashing. For users (and for us), this is BAD. We want us and our users to have insight when something goes wrong and why.
Overall, the process was fairly simple (but perhaps a little time consuming)
I started by writing a NodeJS express app (with a linked MySQL database) that securely takes in error data and anonymously stores it, returning success to the app to tell it to continue running and how to handle the problem. On the app side, I created a static / shared class with a singleton object that we can summon from across the app to log the error.
It seems to work pretty well! And, I got some help from ChatGPT to optimize a few lines of the code.
Next Steps
The plan for this coming week is to support the building out of the next version of Dub - while a lot has been done with wallets, browsing, etc… there’s a lot of small upgrades that still need to happen.
Most importantly, I need to push through the data pipeline for retrieving blockchain data - i.e., tokens in a wallet, their $ values, NFTs, & surrounding metadata.
Other than that, I’ll continue pushing on cleaning up any remaining errors
More to come soon. See everyone next week! 👋