antonio-mello-ai commented on PR #62900:
URL: https://github.com/apache/airflow/pull/62900#issuecomment-4013169836

   Thanks for the direction @bbovenzi. You're right — optional chaining alone 
was papering over a type-system gap.
   
   I've updated the PR to fix the `HealthInfoResponse` datamodel instead:
   
   **Python model** (`monitor.py`): `metadatabase`, `scheduler`, and 
`triggerer` are now `| None = None`, matching the existing `dag_processor` 
pattern.
   
   **TypeScript types** (`types.gen.ts`): Updated to reflect the model — all 
four fields are now optional.
   
   **Rationale**: The API endpoint always returns these fields, but the 
frontend can receive partial/empty responses when a reverse proxy intercepts 
the request (the original issue #62697 was caused by an nginx location rule 
matching \`/health\` and returning an empty \`200 {}\`). Making the fields 
optional in the model ensures the TypeScript type system enforces safe access 
patterns for all consumers, rather than relying on ad-hoc optional chaining. 
This is consistent with \`dag_processor\` already being modeled as optional.
   
   The \`Health.tsx\` optional chaining from the previous commit is now 
type-correct — TypeScript requires it because the types say these fields can be 
absent.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to