Skip to content

fix: initiate hold after overflight when handoff accepted - #14

Merged
YuKitsune merged 5 commits into
mainfrom
fix/handoff-after-hold-point-overflown
Jun 24, 2026
Merged

fix: initiate hold after overflight when handoff accepted#14
YuKitsune merged 5 commits into
mainfrom
fix/handoff-after-hold-point-overflown

Conversation

@YuKitsune

@YuKitsune YuKitsune commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Hold tracking didn't kick in for flights handed off to us, and once it did the state often got stuck. This PR fixes:

  • Hold not initiated when the hold point is already overflown at handoff acceptance (same class of bug as Window disappears after overflying the hold point #11, different code path).
  • No window during the handover-in phase.
  • HoldEntryTime never refreshed from holdSegment.ATO once the aircraft actually overflies.
  • Item colour stuck on Handover after accept, due to ambiguous IsHandoff / HandoffController semantics. State is now derived from the track's HMI state.

Fixes #13
Fixes #15

When another sector originates a hold and the aircraft overflies the hold
point before the handoff is accepted, InitiateHold skipped the overflown
waypoint and silently bailed, so the hold never appeared in our list.
Reuse the same lookback logic as the parser and segment finder.
When a handoff is accepted, vatSys may swap the FDR object. The new FDR
already has IsTrackedByMe=true before we subscribe, so no PropertyChanged
event fires for the transition and OnFDRPropertyChanged never runs. The
sync block in SubscribeToAllFDRs only updated existing holds; extend it
to also initiate holds for tracked FDRs with hold text but no existing
hold item.
InitiateHold was gated on IsTrackedByMe, so a flight in the handover-in
phase (IsHandoff=true, IsTrackedByMe=false) wasn't tracked until the
handoff was accepted. UpdateHoldItemFromFDR already supports the Handover
state, so allow initiation when either flag is set.
HoldEntryTime was set once from holdSegment.ATO at hold creation, but
ATO is only populated when the aircraft actually overflies the hold
point. Holds created before overflight ended up with a default entry
time that never updated. Re-read ATO in UpdateHoldItemFromFDR so the
entry time reflects the actual overflight time once available.
FDR.IsHandoff and FDR.HandoffController don't cleanly distinguish
incoming-handoff-accepted from outgoing handoff: HandoffController can
remain set after an incoming accept, leaving the item stuck in the
Handover state and colour. Read MMI.HMIStates from the track instead,
which has the unambiguous transitions we need (Jurisdiction, HandoverIn,
HandoverOut). Initiation gates also use the same helper for consistency.
@YuKitsune
YuKitsune merged commit 7c1b6d8 into main Jun 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hold entry time missing from list Accepting a handoff with an active hold doesn't open the hold list

1 participant