till213 / SkyDolly

Sky Dolly connects with Flight Simulator 2020 and records the flight path and basic instruments for replay.
MIT License
84 stars 10 forks source link

KML chrashes Sky dolly with no meaqssege just chrash. #179

Closed HLE84 closed 1 month ago

HLE84 commented 1 month ago

Screenshot 2024-10-10 091731

HLE84 commented 1 month ago

https://www.flightaware.com/live/flight/HELI88J/history/20241009/1133Z/ETHB/ETHB/tracklog

Here i downloaded this and made the aircraft airbus 135 helicopter but chrash when trying to import .KML

till213 commented 1 month ago

By the way, you can create ZIP archives and attach those to github issues.

But the direct download link is also helpful!

I will try to reproduce this issue.

Just to make sure: you are using the latest Sky Dolly v0.19.2, correct? And you unzipped the ZIP archive to a new folder (not into an existing Sky Dolly folder), to make sure that only the latest DLLs („plugins“) are used when running Sky Dolly?

And what KML flavour did you select in the KML Flight import dialog (in the dropdown option widget)?

till213 commented 1 month ago

I can reproduce this issue: at first sight this looks like a - somewhat embarrassing - regression due to a new feature as introduced in Sky Dolly v0.19 (namely the separation of aircraft position- and attitude records).

Expect a bug fix asap.

HLE84 commented 1 month ago

very nice, so its all KML at the moment?

till213 commented 1 month ago

its all KML at the moment?

Yes, it is a generic regression that has been introduced with Sky Dolly v0.18 already: while I properly check the "recorded position count" (which was sufficient in Sky Dolly v0.17 and before, as the position- and attitude data was in the same record ("struct")) I do not check the recorded "attitude count" (which is now a separate record) when "augmenting" the imported flight data (such as with additional attitude, velocity etc. attributes that are typically not part of the imported data, depending on the file format).

So I was accessing the "first" element of a data collection that was empty - not good ;)

As I said, this is an embarassing bug that I could have easily discovered myself, had I just imported such KML files myself (note that I actually did import KML files in the recent past, but those coming from flightradar24.com - and those do contain velocity data, so during import I actually created attitude records and the bug did not occur!).

By the way it also affects other import formats that do not generate "attitude records" on their own - not just KML files from flightaware.com!

What I now did yesterday was to extend my unit tests (yes, while Sky Dolly is by far not fully covered with unit tests there actually are some - including for certain file import formats) with additional import formats, and - most importantly - I refactored my "import code" such that the "flight augmentation" (which caused the wrong data access in the first place) gets also unit-tested. And most of my unit tests are now "red" (locally, on my development computer), that is I can reproduce it now also in an automated way and fix it accordingly. By the book: "Test-driven development" ;)

Again, thanks for reporting and I am sorry for the inconvenience. This is litteraly the first "crash" that has been reported since the introduction of Sky Dolly!

till213 commented 1 month ago

Fixed in Sky Dolly v0.19.2