3

This morning I found out that the code I wrote to convert json data to a new format in our DB was giving errors and a bunch of questions got saved with the wrong property. It was assumed when it was triaged with my boss that we would only see one key property so the code written by me so the code was aimed at that. Well some questions have multiple keys for no reason. They are mostly floating data that hasn't been wiped clean because the develop who wrote this use json data in psql with no validation or data cleaning. This edge case was also never caught on PR reviews and we got a pretty heavy review process. I'm not being blamed for it. Most of it I think all the devs feel bad we didn't catch this because it affected us greatly. I've been working all morning trying to resolve it with my boss and just now in the evening we stopped. I just feel like I'm not a good dev at all and just want advice on how to deal with situations like this. I'm a new dev and this is my first job I have held for almost a year

Comments
  • 4
    If specifications are wrong its not much you can do.

    Unless there are test data that trigger the problem you are unlikely to guess it might happen.

    You usually expect json data to follow some pattern.

    If it randomly does not fit, its always going to be trouble
  • 2
    @Voxera yeah, it was a surprise to us. I mentioned before how I heavily dislike json columns on psql just because it can lead to developers writing bad data sets and then we faced this problem. Our app is huge and there is a bunch of tech debt sadly
Add Comment