Saturday, February 22, 2014

REALLY!?! - On the Problem of Incomplete Data

A couple of months ago, the Austrian Federal Railways (ÖBB) opened their data for Google (maps). Whether this can be already considered "open data" or not, is not todays subject.  Wiener Linien (let's call them the Vienna Transport Authority) did not.

My concern is, that Google now has the time table data of the railways, but not of the (local) public transport in Vienna (underground, tram, bus).

Which leads to incomplete data for commuters in and around Vienna (within Google Maps), or a segment, which I in reverence of SNL like to call



REALLY!?!

So, because there is no underground/metro/tube data. Incidentally ÖBB also operate the airport transfer bus, which happens to have a station right next to my office. And thus... Google Maps fills the gap in Vienna with a nice little transfer to the airport and back to my office... Because that's the only routing data (apart from walking) the find.

REALLY!?!
My regular commute time is around 50 mins.
So please, all, get your act together.

Saturday, February 08, 2014

Lightning Drap'n'Drop Problem

In my earlier post (and comment discussion) about Opening ICS Files with Thunderbird/Lightning we mentioned that you can also drag the .ics link directly from the browser to the calendar pane in Thunderbird/Lightning.
I also found, that this is not always working.

So - as promised - I looked into this a bit.
First, narrow down the "not always" to something reproducible:

I took a link that I knew was working with drag&drop (actually from the timetable of the Austrian Federal Railways), and verified this. Yep, working nicely

Then I just downloaded the resulting .ics file to my local hard disk into a folder that was mapped into my webserver (Tomcat 7). I wrote a tiny .html file that mainly included a link to the .ics file.


Then open the html file in Chrome/Firefox and drag the download text/link into (or is it onto?) the Lightning calendar pane in Thunderbird. Ignore the second line for a second (no pun intended).

Nothing.

Well, that was surprising... So I went on to waste a lot of time with checking the mime-type etc etc.

But it was fine by responding with "text/calendar" - see:

So I took some Java drag&drop code I had, and took a closer look at the data included in the DnD object. Also everything fine there (I spare you the details here).

By chance I looked into the access log of the webserver and found the following:

GET /test/download.icsdownload HTTP/1.1" 404 1001

Which essentially says, that Thunderbird requests a broken URL. It should GET /test/download.ics and not /test/download.icsdownload

No wonder it gets a 404 and cannot import anything.

Quick test to include a "?" in the a href (see above, the second line I asked you to ignore earlier).
If you drag this one, you'll get a
GET /test/download.ics?download? HTTP/1.1" 200 949



As we are handling static files here, the "?download?" appended to the filename will gracefully get ignored and the file will get served (as can be seen by the 200 response code)
And with this link, Thunderbird really imports the file and opens the event dialog.

Fine there.

What Lightning does, is - wrongly - append the text of the html anchor ("download" or "download?") to the URL. You can test with naming the anchor asdfgh and will see that /test/download.icsasdfgh will be requested.

Why does it do it ?

It seems to be that Lightning picks up the HTML fragment data type that gets passed by DnD. The browser passes the full anchor, from begin tag to end tag (see above), and Lightning stupidly parses until the first newline (\n), and throws away the HTML tags.
This is wrong.
Should not happen.
I'll file a bug in bugzilla.