Fighting Bugs

For the last couple of weeks, I spent a number of hours tracking down a bug. This bug was just related to converting the case of the fields in the DTO to be compatible with the controller. I wasn’t doing any conversion, so it defaulted to FirstName, LastName, etc…

What made this particular bug hard to find was that the LoginDto was working just fine, whereas the ProfileDto was failing with a 400 error when the endpoint was called in the controller.

LoginDto worked because Email and Password are just single words; thus, they are compatible with the controller. The LoginDto also had a RememberMe bool, but because a bool defaults to false, even if I passed in RememberMe or not, it would just default to a false because it would ignore RememberMe.

I used Postman to figure it out by passing in the raw data. After realising what happened, I switched all items to snake_case, FirstName to first_name, etc. This resolved the issue, and there were no more complaints that my payload was missing the needed data.

Why I Mention This

I’ll give a more detailed example on my programming blog, but I posted this here to highlight that some things can slow you down. This took several hours to track down, and in the end, it was something straightforward that was overlooked. Time to move forward now! Hopefully, we will get a beta out before the end of 2023.