Skip to content

Conversation

chriseckman
Copy link
Contributor

This feature improves the logic around handling multiple flights scheduled for the same day. Previously, the check-in logic did not account correctly for flights with passengers whose boarding groups had not yet been assigned (null), potentially causing a subsequent flight on the same day not to check in successfully (resolving issue #266).

Changes included:

  • Updated check-in logic to only count flights that have passengers with valid (non-null) boarding groups.
  • Enhanced logging to explicitly report the number of flights successfully checked in, aiding troubleshooting.
  • Added integration tests to simulate scenarios with multiple flights and verify correct handling and validation of boarding groups.

@jdholtz
Copy link
Owner

jdholtz commented May 19, 2025

Thanks for tackling this! If I'm understanding correctly, Southwest will return both flights for the same-day flight after the check-in time of the second flight, but then not assign a boarding group/number right away? I guess that would make sense as notifications for passengers are only being sent if they have a boarding group, so this wouldn't have been caught before.

Were you test these fixes on a same-day flight? The logs would be interesting to see if you did.

@chriseckman
Copy link
Contributor Author

Hi @jdholtz,

Your understanding matches mine. Based on reviewing the logic of the code and the scenario described in issue #266, the Southwest API returns both flights for the same-day reservation upon the check-in request. However, it initially only assigns a boarding position to the flight being checked in at its appropriate check-in time (24 hours prior to departure). Previously, the script incorrectly assumed the second flight was successfully checked in alongside the first, reusing the boarding position from the initial flight. This caused the confusion observed in the user's screenshot from issue #266.

For additional context, the reservation object returned from the API in the method CheckInHandler._check_in_to_flight includes a "checkInConfirmationPage" key containing a "flights" list, which lists all flights under the reservation. The method CheckInHandler._attempt_check_in processes this data explicitly:

reservation = self._check_in_to_flight()
flights = reservation["checkInConfirmationPage"]["flights"]

The updated logic specifically verifies each flight individually, retrying the check-in process until the boarding position is confirmed as assigned by the API. This ensures that each flight is accurately checked in, resolving the issue described.

I didn't test this scenario with actual flight data myself; my analysis and solution are based solely on the reported issue and a detailed review of the related check-in logic.

Let me know if you need further clarification or additional details!

@jdholtz
Copy link
Owner

jdholtz commented May 29, 2025

Thanks for the explanation @chriseckman, makes sense.

I didn't test this scenario with actual flight data myself; my analysis and solution are based solely on the reported issue and a detailed review of the related check-in logic.

Before submitting this change, I would like to get verification that the API does indeed behave this way. I'll mention this in #266 for anyone to test. Thanks!

@jdholtz jdholtz added the awaiting testing Pull Request is awaiting testing in a real-world scenario label Jun 24, 2025
@jdholtz jdholtz linked an issue Aug 27, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting testing Pull Request is awaiting testing in a real-world scenario

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2nd flight on same day didn't checkin successfully

2 participants