The art of the commit message and PR description

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 »

Selenium and Asynchronous Javascript

When using Selenium in automated tests, sometimes it becomes necessary to execute Javascript. Whether that’s due to the presence of a canvas that has no obvious click zones, or because of important information attached to the page that’s not visible from the DOM, here’s a trick that may help you out along the way.

Continue reading »

Calling All Elixir Actors

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 »

Rails Migrations: When you can't add a uniqueness constraint because you already have duplicates

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 favorite_color rows.

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.

Continue reading »
Top