Skip to content

Commit 2bcdbc3

Browse files
committed
fix missing static data in webviewer when a ship comes back in scope
1 parent 5669546 commit 2bcdbc3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Source/Tracking/DB.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ bool DB::updateShip(const JSON::JSON &data, TAG &tag, Ship &ship)
934934
ship.group_mask |= tag.group;
935935
ship.last_group = tag.group;
936936

937+
std::time_t prev_signal = ship.last_signal;
937938
ship.last_signal = msg->getRxTimeUnix();
938939

939940
if (repeat == 0)
@@ -962,7 +963,12 @@ bool DB::updateShip(const JSON::JSON &data, TAG &tag, Ship &ship)
962963

963964
ship.setType();
964965

965-
if (staticUpdated)
966+
// Ship came back into dashboard scope after being gone long enough that
967+
// frontends will have dropped their cached entry. Replay static on the
968+
// next incremental poll by bumping last_static_signal.
969+
bool back_in_scope = prev_signal > 0 && ship.last_signal - prev_signal > TIME_HISTORY;
970+
971+
if (staticUpdated || (back_in_scope && ship.last_static_signal > 0))
966972
ship.last_static_signal = ship.last_signal;
967973

968974
if (positionUpdated)

0 commit comments

Comments
 (0)