Skip to content

[BUG] Flights.vue widget fails to fetch the flights data from aerodatabox (API may have changed) #1939

@rnowotniak

Description

@rnowotniak

Environment

Self-Hosted (Docker)

System

Firefox 143.0, Brave version 1.82.166

Version

3.1.1 - latest

Describe the problem

Flights.vue component in Dashy version 3.1.1 (and all earlier) tries to fetch the flights data from
https://aerodatabox.p.rapidapi.com/flights/airports/icao/
and it tries to get the flight time from actualTimeUtc:

          time: flight.movement.actualTimeUtc,

However, actualTimeUtc field is absent in the current API schema (reference: https://doc.aerodatabox.com/index.html#operation/GetAirportFlights ). Possibly the API has changed since the widget creation.
It results with an error in Dashy UI:

Image

aerodatabox rapidapi API provides scheduledTime.{local,utc} and revisedTime.{local,utc} instead of the absent actualTimeUTC.

Some flights don't have the aircraft model set, which result in the Widget error too, e.g.:

Image

Also, both Departures and Arrivals lists are shown by the widget although direction is set to just one.
Below code logic is wrong. departures array is always populated, no matter of the direction value.

  <!-- Departures -->
  <div v-if="departures.length > 0" class="flight-group">
    <h3 class="flight-type-subtitle" v-if="direction === 'both'">
      {{ $t('widgets.flight-data.departures') }}
    </h3>

I created a fix for Flights.vue component, so I'll raise a PR.

Additional info

No response

Please tick the boxes

Metadata

Metadata

Assignees

Labels

🐛 Bug[ISSUE] Ticket describing something that isn't working

Projects

Status

Awaiting Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions