Here at Devpost, our goal is to celebrate software creators. We think that developers want to work with other developers that they are inspired by and look up to. This is our first step in exploring whether or not that is true.

How it works

Anyone can add a "Work with Me" button to their profile by visiting their Settings Page and filling out the Is your company hiring? field on their user settings page like so:

Is your company hiring? field

After filling out this field, you will see the "Work with Me" button appear on your portfolio as well as alongside your contributions to any projects that you have created or worked on.

Challenges I ran into

I did run into an interesting race condition with our use of the Mixpanel javascript snippet that kicks off the asynchronous script download and initializes the client. We were kicking off the script download in the head, but were calling mixpanel.init towards the end of the body. It looks like both the snippet and the Mixpanel client define mixpanel.init, meaning that half of the time we were calling the one from the snippet and the other half of the time we were calling the one from the downloaded library. This means that our calls to mixpanel.track_links were only working about 50% of the time and tracking clicks on the button was not going well.

I'm not 100% sure given the minified nature of the snippet, but I believe it queues up any calls you make to Mixpanel before the library has finished downloaded, and then sends them when the client has fully downloaded. The client however also defines mixpanel.init to replace the one defined by the snippet incase the client library is finished downloaded before mixpanel.init is called. It seemed like our calls to mixpanel.track_links were lost in the latter scenario when we were calling the initialize method of the full client library.

Moving our call to mixpanel.init from the end of the body to the head right after the async download is kicked off resolved the issue and ensured that our calls to mixpanel.track_links were always recorded.

Accomplishments that I'm proud of

I'm proud of fixing our race condition, mostly because we didn't know it existed until now, and I really had to dig into the snippet provided by Mixpanel as well as the client code.

What I learned

I learned that if you're going to copy and paste code snippets from Mixpanel for working with their javascript client, you should just copy and paste it without modifying it, because you may end up breaking something or creating a race condition.

What's next for Work With Me

We'll be monitoring the Mixpanel data to see whether or not users are engaging with the button, which page the buttons are more often clicked on (portfolio vs project details page), etc. We'll know what's next after we've had time to digest the data and choose a path forward.

Share this project: