This is a pretty simple topic, but one that I find really important. It’s also something I’m pretty proud of that we do on my team… take the time to write good commit messages. Additionally, we always try to create pull requests with descriptions that make it easy for any developer to know exactly what was done and why. This makes it easy for a new developer contributing to the project or even a seasoned developer changing old code to understand why things were done previously.Continue reading »
Elixir’s Actor Model
Concurrent computation, it’s unescapable. Elixir is known as a highly available concurrent language, but what does this really mean? Elixir’s concurrency model is built on the Actor Model, but what is it?Continue reading »
For work, I picked up a bug where a CSV export was creating duplicate rows when it shouldn’t have been.
We generate the CSV export with a big ol’ SQL statement in some Elixir workers, and got the bug reproduced and found the problem was with how we did some joins on other columns.
We had something in the statement like this:
LEFT OUTER JOIN `reports` ON `reports`.`id` = `people`.`report_id` LEFT JOIN `addresses` ON `addresses`.`people_id` = `people`.`id` LEFT JOIN `favorite_colors` ON `favorite_colors`.`people_id` = `people.id`
In this highly contrived example, I found out that we’re expecting a single row in the
favorite_colors table for each
person, but we were getting multiple
Every time we had a duplicate row on that joined table, the
LEFT JOIN created two rows in the export, even though there should have been one.