I ran into an issue a few days ago after pushing some hand rolled “infinite scroll” logic to my sites. One of my users reported getting the “Failed to open page” error on her Windows Phone 8 using UC Browser, some aftermarket browser I had never heard of. The rest of the site was working fine for the user, but without a WP8 device to test on I was grasping at straws for a reason and solution.
First bit of troubleshooting involved asking the user to give Chrome a shot on her phone. She said she tried it and got the same exact error, FUUUUUUUUUU… but that’s my go to answer for everything!! Funny thing is that I took this as the gospel but recently found out that Chrome is not even available for WP8 (thanks Zack for confirming!). A lapse of judgement on my part for trusting something without being able to see it. This was infinitely frustrating because the user was sending me messages all weekend (my birthday weekend mind you) about how frustrated she was with the situation.
To continue my ranting a bit, the fact is that Windows Phone 8 makes up less than one half of a percentage point of all of our traffic. I wanted to get the issue resolved, but obviously such a low market share cut the urgency down a ton. The other fact is there’s no WP8 emulator outside of Windows. Dear Microsoft, if I have to support your janky ass systems and browsers the least you can do is get a cross platform testing suite out there for free. There’s no way that I will be buying a WP8 device but I was on the verge of buying a copy of Windows because I really did want to get the issue resolved.
So the next step was to verify that the user was on WiFi or using cellular service. She said she was on WiFi so the issue probably wasn’t related to that. What about on one of our other sites that runs on the same codebase? Yep, same issue there. Next up was disabling the new code to handle the infinity scrolling. No dice, same error.
Now when I originally started building the scrolling I was toying around with jQuery Waypoints as it seemed like it would cut down on my development time. Didn’t really care for it so I rolled my own and deleted the file from the repo. Turns out, I forgot to remove the script tag for the JavaScript file I had removed. It took a few days to realize as I didn’t check any log files this weekend as I went to see the kiddo’s dance competition on Saturday and it was my birthday Sunday, so yeah, priorities and such 😉
The error logs were a bit bloated today and I saw that it was an error to the PICKLES Dynamic
class that handles minifying resources throwing an exception about the missing waypoints.js file. I fixed the code and pushed it out and the user was able to verify that it was working again. Incidentally, when I originally encountered the error there was nothing abnormal with the error log, can’t really explain that one unfortunately.
What’s quite interesting is that I log PHP errors in production and never display them to the user. In the instance of an exception, the code will terminate but the placement of the script tags was at the bottom of the page so there was nothing noticeable when the exception was hit aside from the log entries. No browser or system I tried (Chrome, Firefox, Safari, IE 10 & 11 on OSX, Windows 7 and 8 and iOS) gave any indication that the page couldn’t be loaded aside from WP8. Unsure the exact mechanisms behind it, but it seems as if the exception being thrown was terminating the page load in such a way that told WP8 that the page failed to load and hence the aggressive error message.
Microsoft quirks aren’t going away any time soon so this all begs the question, how do I detect this in the future? My thought is getting a bit more aggressive with New Relic’s alerts in regard to the error rate. I’ve been working towards having absolutely no errors in my PHP code (I fall into “happy path” coding just as much as the next guy 😉 so anything over 0% error rate should be throwing an error. There’s also a good chance that I’ll roll a small shell script to check the log file periodically and send me an email if the number of new errors is more than a certain threshold.
Anyone else out there run into something like this with Windows Phone 8? Would love to hear about, comment below!