Catalan independence is Brexit with helicopters

Catalan independence is Brexit with helicopters. … a very poorly thought-out idea, taken with little thought of the consequences, driven by some strange desire to “take the power back”..

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Release 0.4

Before:

The problem was that when a user tries to download something from the website, the icon in URL bar disappears. The expected result is for the icon not to disappear.

It took me more than three weeks to come to the fix. Moreover, it took me more than two weeks to get to the meaningful progress. I have to admit, this was not an easy bug for me. I struggled a lot. I would struggle for a much longer time if I was left by myself out there.

Teamwork is your friend.

I don’t think I ever was as happy when I fixed a bug as I was when we fixed this issue.

Proof:

The second it got fixed, I was crying and laughing at the same time. That is the reaction you get for something that you spend not just hours, but days working on non-stop. When it wasn’t working ( or wasn’t fixed properly ) for so long after you debugged that much lines of code. Attempt after attempt, I was questioning myself if I would ever fix it. So many times when from time to time I almost gave up. All that was totally worth the moment. Hard work pays off.

Which in developers tools showed the following (to open dev tools in Brave press shift+F8) :

If we run the changes in the browser we will see the following:

Next step was to search where isSecure is being set to null.

After more debugging, we found out that in frame.js on line 691 (as you can see on the above ) if we will change the value of isSecure, the result won’t change. Since we knew that the isSecure becomes null somewhere. We needed to find where exactly. First, we looked for every isSecure = null, after that we run the console log to see the if it is called there, then we changed the values of isSecure to see if that affects anything. It wasn’t. But, we found in the same file, a little below (on line 721), we are calling a function to change the state:

In windowStore.js, there is a function which resets the state:

When we changed the value of isSecure from null to true. Guess what happened. Now, isSecure was never null.

So okay, this is closer to what we want. But what are we actually suppose to do? If I change this value to be secure, then it will always be secure and vise versa. This wasn’t really a solution.

Then we tried something interesting, we tried to comment out that code at all. The result was totally surprised at least for me.

It actually worked!

However, the comment for the function kinda was telling us that this function has a purpose and it is supposed to be there. It said that it is for resetting the state, but we needed to know more. Therefore, we went to GitHub to that function and we checked git blame.

We saw that that code was part of this fix and of course, it was very much needed and it wasn’t some kind of a code without purpose. We spend some time trying to figure out how that fix worked and where and how and what should we do to fix our issue. That was another moment when we got stuck.

Then we noticed another interesting thing, turns out that the bug wasn’t happening with PDF files, which means that somehow it is handled for the PDF’s. Therefore we start searching how and where in the code the PDF’s are being handled.

Extremely helpful reply

Which means that for the normal download link, we handle it like it is a new page. So if we would check if the link is not a new page, then don’t reset the state. Eventually:

We don’t reset the state! Bingo! It was the right place. We knew that we need to check if we are on the current page we don’t need to reset the state. After a couple of attempts, it worked!

Add a comment

Related posts:

Am I missing something?

The stats show that more of us are listening to podcasts, up from 12% of Americans in 2013 to 24% in 2017. Our lives are getting busier and podcasting acts as a time saver, allowing us to multi task…

Building on a good reputation.

Visit almost any city or major town in the world and you will be confronted by the same images, the same brand names — Coca-Cola, Mastercard, Nestle, Nike, VW. We now have instant news available…

A Trillion Dollars to a Homeless Man

Yesterday I found a newspaper left on a picnic table It said Apple had become the first trillion-dollar company A trillion, hell, I don’t even know if I can count to a million I know their phones all…