Skip to content

fix: anchor check-in and gate closure times to scheduled departure - #194

Merged
TargetMisser merged 2 commits into
mainfrom
claude/flight-etd-closure-times-o3g5ah
Jun 25, 2026
Merged

TargetMisser merged 2 commits into
mainfrom
claude/flight-etd-closure-times-o3g5ah

Conversation

@TargetMisser

Copy link
Copy Markdown
Owner

Problema

Gli orari di chiusura check-in e gate venivano calcolati usando getBestDepartureTs, che restituisce il tempo reale/stimato (ETD). Di conseguenza, se un volo ritardava, tutti gli orari di chiusura si spostavano insieme all'ETD — comportamento errato dal punto di vista operativo.

Soluzione

Gli orari di chiusura (check-in open/close, gate open/close) devono essere ancorati al tempo schedulato (STD) e non cambiare mai in caso di ritardo. Solo l'orario di partenza effettivo (per la visualizzazione e la notifica di partenza) continua a usare l'ETD.

Modifiche

  • FlightScreen.tsx — widget: filter e map usano getScheduledFlightTs per il calcolo dell'overlap sui tempi di chiusura e per i valori ciOpen/ciClose/gateOpen/gateClose; departureTs e departureTime continuano a usare l'ETD.
  • autoNotifications.ts: i timestamp delle notifiche di chiusura (CI apre/chiude, gate apre/chiude) sono calcolati dallo STD; il testo "partenza alle…" nel corpo notifica mostra comunque l'ETD.
  • flightNotificationScheduler.ts: le fasi del volo pinnato relative alla chiusura usano STD come base; solo la fase pinned_departure usa l'ETD.

Test plan

  • Volo puntuale: check-in e gate closure mostrano orari coerenti con lo schedulato
  • Volo in ritardo (ETD > STD): check-in e gate closure non cambiano rispetto a prima del ritardo
  • Widget home screen: orari di chiusura invariati al cambiare dell'ETD
  • Notifiche pinned: CI open/close e gate open/close scattano all'orario schedulato, non all'ETD

Generated by Claude Code

Closure times (check-in open/close, gate open/close) must be computed
from the scheduled departure time (STD) so they never drift when a flight
is delayed. Previously getBestDepartureTs was used, which follows the
real/estimated time and would silently shift all closure timestamps
whenever an ETD update arrived.

Changes:
- FlightScreen widget: filter and map now use getScheduledFlightTs for
  closure time overlap checks and ciOpen/ciClose/gateOpen/gateClose
  values; departureTs/departureTime still use ETD for correct display.
- autoNotifications: closure notification timestamps (CI open/close,
  gate open/close) computed from STD; departure display text still
  shows ETD.
- flightNotificationScheduler: pinned closure-phase notifications use
  STD as base; only the pinned_departure phase keeps ETD.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwhK5jVxWTojXNS8qTQ4D3
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flight-work-app Ready Ready Preview, Comment, Open in v0 Jun 25, 2026 8:31pm

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GwhK5jVxWTojXNS8qTQ4D3
@TargetMisser
TargetMisser marked this pull request as ready for review June 25, 2026 20:31
@TargetMisser
TargetMisser merged commit 2f4310f into main Jun 25, 2026
3 checks passed
@TargetMisser
TargetMisser deleted the claude/flight-etd-closure-times-o3g5ah branch June 25, 2026 20:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 850bd9dced

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app.json
"name": "AeroStaff Pro",
"slug": "AeroStaffPro",
"version": "2.7.28",
"version": "2.7.29",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Sync package version with native bump

This bumps Expo/Android to 2.7.29 while package.json, README.md, and src/utils/updateChecker.ts remain at 2.7.28 in this commit. scripts/release-check.cjs requires app.json and Android versionName to match package.json, so the release check will fail, and UI paths that import package.json still show the old version.

Useful? React with 👍 / 👎.

const depTs = getBestDepartureTs(item);
if (!depTs || isNaN(depTs)) continue;
const etdTs = getBestDepartureTs(item);
const stdTs = getScheduledFlightTs(item, 'departure') ?? etdTs;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Select closure notifications by scheduled time

Because shiftDepartures is still built from getBestDepartureTs above, this new scheduled-time anchoring never runs for a delayed departure whose ETD moves after the shift even though its STD-based CI/gate close warnings fall during the shift. In that scenario the startup scheduler silently skips all CI/gate notifications for the flight; filter departures by the scheduled/ops overlap before scheduling these STD-based warnings.

Useful? React with 👍 / 👎.

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.

2 participants