Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly allow associated_trip for any event type #297

Conversation

rf-
Copy link
Contributor

@rf- rf- commented Apr 17, 2019

This implements the change suggested in #289 by clarifying that any
trip-ending event can and should have an associated_trip, not just
user_drop_off events.

Since the Provider event system currently doesn't define which states
are allowed to transition to which other states, it's already
spec-compliant to follow a reserved/user_pick_up event with an
unavailable/low_battery event, and this is the most
semantically-accurate way to describe the scenario where a device shuts
down during a trip because of low battery. In this situation, the
implementer should include an associated_trip field in both events
so that API consumers can correctly identify these events as the
endpoints of the relevant trip.

Is this a breaking change

  • Yes, breaking
  • No, not breaking—clients that aren't currently processing this field for these event types can continue to ignore it
  • I'm not sure

Provider or agency

  • provider
  • agency
  • both

@rf- rf- requested review from hunterowens, thekaveman and a team as code owners April 17, 2019 23:57
@rf- rf- changed the title Explicitly allow associated_trip_id for any event type Explicitly allow associated_trip for any event type Apr 17, 2019
This implements the change suggested in openmobilityfoundation#289 by clarifying that any
trip-ending event can and should have an `associated_trip`, not just
`user_drop_off` events.

Since the Provider event system currently doesn't define which states
are allowed to transition to which other states, it's already
spec-compliant to follow a `reserved`/`user_pick_up` event with an
`unavailable`/`low_battery` event, and this is the most
semantically-accurate way to describe the scenario where a device shuts
down during a trip because of low battery. In this situation, the
implementer should include an `associated_trip` field in both events
so that API consumers can correctly identify these events as the
endpoints of the relevant trip.
@rf- rf- force-pushed the ryanf/clarify-associated-trip-field branch from 1309054 to 29760f8 Compare April 17, 2019 23:58
@thekaveman thekaveman added Schema Implications for JSON Schema or OpenAPI Provider Specific to the Provider API and removed Schema Implications for JSON Schema or OpenAPI labels Apr 18, 2019
@thekaveman
Copy link
Collaborator

@rf- @hunterowens so just to circle back, are we OK with this being a language-only change - and leaving the JSON schema alone? Or do we want to add additional event_type_reason that would qualify as requiring the associated_trip?

@rf-
Copy link
Contributor Author

rf- commented Apr 18, 2019

I think user_pick_up and user_drop_off are the only ones that can require it at the schema level. For any other event type, whether it's required depends on context from other stuff in the event stream, so it's probably not possible to nail down further except as part of a more comprehensive state machine definition.

@hunterowens hunterowens merged commit f7a2d7e into openmobilityfoundation:dev Apr 29, 2019
@hunterowens hunterowens added this to the 0.3.1 milestone Apr 29, 2019
@ccolgrove ccolgrove mentioned this pull request Apr 30, 2019
rf- added a commit to remix/mobility-data-specification that referenced this pull request Aug 16, 2019
PR openmobilityfoundation#297 already updated the spec language to make it clear that any
status change is allowed to have an `associated_trip`, but I didn't
realize this was incompatible with the existing schema. The schema
should now match the spec, which states that `user_pick_up` and
`user_drop_off` events must have an `associated_trip` but other events
may have one when applicable.
hunterowens pushed a commit that referenced this pull request Oct 1, 2019
PR #297 already updated the spec language to make it clear that any
status change is allowed to have an `associated_trip`, but I didn't
realize this was incompatible with the existing schema. The schema
should now match the spec, which states that `user_pick_up` and
`user_drop_off` events must have an `associated_trip` but other events
may have one when applicable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Provider Specific to the Provider API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants