I joined a hot startup as a developer two weeks ago, and one of my first tasks was to review the work of another developer, test it, and deploy it. This is my first job as a developer, coming from a mechanical engineering background.
The code itself wasn't that difficult. I reviewed it and tested it. It worked fine, and it's been working fine for the past week. I even watched it for a few days on our production server and it was succeeding 100% of the time, so I figured it was good to go and moved on to my next task.
Just today we spotted a bug on our production server where a small number of requests have started failing (way less than 1%). We traced it back to having only started yesterday.
We root caused it as being caused by the code I tested and deployed. And I'm pretty much being blamed for it.
The bug itself only happens extremely infrequently. The code base is legacy and the developer assumed that we could get our data from a specific object, but it turns out in an extremely rare case this object isn't populated (and believe me, there are thousands of lines of legacy code that goes through this object and it’s implied to always be populated by its usage and naming). There aren't any comments anywhere mentioning this can happen and the code itself has tons of technical debt.
I was under a tight deadline to complete this task too, and I feel that even if I had more time I wouldn't have found it either.
What should I do? Am I really at fault here? Did I screw up? What am I supposed to do in the future, so this doesn’t happen again?