Fork, Forget, or Rebuild: What Happens if You Have a Different Use Case in an Open Source Project?

iRonin IT Team - Experts in software development

When your code updates don’t get accepted to an open-source project. Whether to fork, forget, or build elsewhere: sometimes it’s a combination of approaches that is the winning strategy.

One of the issues in working with external open source in commercial application development, is that these external libraries are not going to be able to do everything that you want. One of the things that you can do is become a contributor and send a pull request to the project, building out the feature set yourself. But then what happens if these changes aren’t accepted? Your use case may indeed be different from the library’s author’s. Let’s take a look at one example that we encountered.

Some time ago, we made a Pull Request to the authentication library we use in our project, however the changes were not merged. While the code itself we created was sound, the issue turned out to be with the use case that we were proposing. In the end, the author did not want to support initial automatic token refreshing, if wasn’t working with other subsequent requests to the API. Our PR (Pull Request) assumes that the token could only be expired during the initial page load period - which is correct if you build a pop up Chrome Extension and each token expires after 24 hours.

We provided more info about our problem (that the Chrome Extension which needs to fetch user data - to enable redirection to a specific page based on the user’s data - when the pop up opens). Ultimately if the author of a library doesn’t want to accept your changes they do not have to - the code’s design and intentions is entirely up to them. This means that we will have to fork their code if we want to include our changes for use. However, in order to maintain our fork as easily as possible (meaning: avoid as many conflicts as possible with upstream code - the main repository where the author pushes new changes), we decided to move as much code as possible from this add-on layer to the application layer instead, to support our use case.

Unfortunately, we still need a fork in order to refresh the token automatically when it expires and log a user out if refreshing wasn’t successful. By moving as much of the logic as possible to the application layer, we have a minor fork to the author’s main repository, so that updates/merges are as as painless as possible.

Our team of expert devs encounter these sorts of interesting quandaries throughout the course of their work. With a wealth of experience and tech knowledge behind them, they are able to make clever, informed decisions to help projects advance smoothly and efficiently. If you are looking for enhanced business-oriented software development, then have a chat to the iRonin team to learn about what we can do for you.

Author's Bio
iRonin IT Team

Experts in software development

We are a 100% remote team of software development experts, providing web & mobile application development and DevOps services for international clients.

Similar articles

Bulletproof your development with remote team augmentation

Read how
This page is best viewed in portrait mode
Our websites and web services use cookies. We use cookies and collected data to enhance your experience, provide additional communication channels, improve marketing materials and enhance our offer. IRONIN SP. Z O.O. SP. K. is committed to protecting all the data that we collect or process in any way, especially data of personal nature. By accepting these terms you agree to our usage of cookies and processing your data, according to our Privacy Policy, and you declare that your browser settings reflect your preferences. Read more You have the right to revoke this agreement at any time, based on the terms of our Privacy Policy. You can change cookies settings in your browser. If you do not agree with us using cookies and processing your data, please change your cookies settings in your web browser and reject these terms. You can find more information about cookies, your data privacy This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies. data processing, and your rights in our Privacy Policy.