Last modified: 2014-02-28 16:24:34 UTC
There's a lot of places in the feed processing for the Windows 8 app where unexpected data formats just kill the app. Need to add better error handling so it survives any input.
Could you give me an example?
I unfortunately didn't save a broken sample feed, but last one I had to fix was a weirdly-formatted entry in I think the 'featured articles' feed on en.wikipedia.org. Here's the workaround I put in place to fix that: https://en.wikipedia.org/w/index.php?title=Wikipedia:Today%27s_featured_article/January_20,_2013&diff=534362579&oldid=533956507 this adds a hidden link to the item that took priority over the media item or whatever that was in there that got misdetected. All the code in default.js is a bit ..... haphazard, it needs a refactor. :) But there'll be a bit that fetches a feed like this: fetchFeed(lang, 'featured', function (htmlList, err) { .... and inside there is where the Evil Code lies. There's stuff like this: var $html = $('<div>').html(html), $links = $html.find('a'), $imgs = $html.find('img'), title = '', image = ''; for (var i = 0; i < $links.length; i++) { var $link = $($links[i]); if ($link.find('img').length) { // Skip a link containing an image continue; } title = extractWikiTitle($link.attr('href')); break; } which tries to extract an image and a wiki link from the entry. In some cases the link ends up being something that's not in the expected "/wiki/Something" format and extractWikiTitle throws an exception. Because the feed-handling code doesn't expect this, the exception doesn't get caught and kills the application before we've gotten a chance to show anything. You can probably pull down a copy of the Atom feed, mess with it, and experience all kinds of fun crashes. :)
Grouping Windows 8 app specific bugs to Wikipedia/Windows 8 component.