vACDM/vacdm-server

TSAT delayed with improved TOBT

Opened this issue · 3 comments

It still happens that if the TOBT is changed and still before the TSAT, the TSAT is delayed.

This should not happen, the TSAT should only be improved if possible in this case.

Example what had happened:
TOBT = 1240 | TSAT = 1255
New TOBT = 1250 | new TSAT = 1305

In this case the TSAT should stay at 1255, but might improve to 1250.

The question is, where to change it.
Either inside the plugin or inside the backend?

From the plugin I noticed this:

root["callsign"] = callsign;
root["vacdm"] = Json::Value();
root["vacdm"]["tobt"] = Airport::timestampToIsoString(tobt);
root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime);
if (false == manualTobt)
  root["vacdm"]["tobt_state"] = "NOW";
root["vacdm"]["ttot"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["asat"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["aobt"] = root["vacdm"]["tsat"].asString();
root["vacdm"]["atot"] = root["vacdm"]["tsat"].asString();

After each TOBT-update we set the TSAT to -1. Therefore the List in Euroscope gets empty for user feeedback reasons.

But if the TSAT is -1, the backend will calculate a new one.

IMO we have to decide wheter we change the plugin behaviour or the backend logic.
Maybe @dotFionn, and @LeoKle can say something about.

Should be done inside the plugin.

We agreed on the general architecture that the plugin defines the timestamps due to UTC vs TAI conflicts between the backend and the frontend. Otherwise can it happen that the plugin and the backend expect different behaviours if the current time and TSAT are close enough.

Expected behaviour:
Plugin keeps TSAT if current time < TSAT, otherwise reset TSAT, too
Plugin shows TSAT with a star, of TOBT is -1 and TSAT != -1.

Instead of hiding TSAT is it better to show it with a flag to have a visualization that shows the real internal data.

This issue still happens quiet often and is one of the most annoying ones, as pilots are sometimes ready before their TSAT window.