Uh oh!
There was an error while loading. Please reload this page.
Draft improvements from assistant conversations: event location nulls & event filtering - #284
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Uh oh!
There was an error while loading. Please reload this page.
| ## When `location` and `location_locode` are null | ||
| On transport events, both `location_locode` (and any related `location` object) are nullable. They may be `null` when: |
There was a problem hiding this comment.
Minor grammatical awkwardness: "both X (and Y)" uses a parenthetical where a straight conjunction is cleaner and less ambiguous.
| On transport events, both `location_locode`(and any related `location` object) are nullable. They may be `null` when: | |
| On transport events, both `location_locode` and any related `location` object are nullable. They may be `null` when: |
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/api-docs/in-depth-guides/event-timestamps.mdx
Line: 45
Comment:
Minor grammatical awkwardness: "both X (and Y)" uses a parenthetical where a straight conjunction is cleaner and less ambiguous.
```suggestionOn transport events, both `location_locode` and any related `location` object are nullable. They may be `null` when:```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| --- No newline at end of file | ||
| --- | ||
| This endpoint returns the container's full normalized transport event history — vessel, rail, transshipment, terminal/gate, delivery, and document events — across the entire journey. It does not support filtering by event type, data source, or timestamp via query parameters. To narrow results to a subset (for example, terminal-only events such as `full_in`, `full_out`, `empty_out`, `empty_in`, `vessel_discharged`, `vessel_arrived`, or `vessel_berthed`), fetch the full list and filter client-side on `attributes.event` or `attributes.data_source`. |
There was a problem hiding this comment.
"Terminal-only events" label may confuse filtering strategies. The sentence presents filtering by
attributes.event and filtering by attributes.data_source as equivalent alternatives for getting "terminal-only" events, but they select along different dimensions. Events like vessel_arrived and vessel_berthed in the example list can originate from carrier data sources (not just terminal data sources), so a user who filters attributes.data_source == "terminal" expecting to capture all vessel_arrived events will silently miss carrier-sourced ones. Consider separating the two strategies — one for filtering by event name and one for filtering by data source — so readers understand they answer different questions.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/api-docs/api-reference/containers/get-a-containers-transport-events.mdx
Line: 9
Comment:
**"Terminal-only events" label may confuse filtering strategies.** The sentence presents filtering by `attributes.event` and filtering by `attributes.data_source` as equivalent alternatives for getting "terminal-only" events, but they select along different dimensions. Events like `vessel_arrived` and `vessel_berthed` in the example list can originate from carrier data sources (not just terminal data sources), so a user who filters `attributes.data_source == "terminal"` expecting to capture all `vessel_arrived` events will silently miss carrier-sourced ones. Consider separating the two strategies — one for filtering by event name and one for filtering by data source — so readers understand they answer different questions.
How can I resolve this? If you propose a fix, please make it concise.Preview deployment for your docs. Learn more about Mintlify Previews.
|
Summary
Close two recurring documentation gaps surfaced by assistant conversations: when transport event
location/location_locodeare null, and whetherGET /containers/{id}/transport_eventssupports filtering.Changes
api-docs/in-depth-guides/event-timestamps.mdx: added a section explaining thatlocation_locodeis nullable on transport events (e.g. on estimated events or when the carrier omits location), that this is expected, and that values are not back-filled on the same event.api-docs/api-reference/containers/get-a-containers-transport-events.mdx: noted that the endpoint returns the full event history with no server-side filter parameter, so callers should filter client-side onattributes.eventorattributes.data_source(e.g. for terminal-only events), and cross-linked the event timestamps guide.Context
Multiple recent assistant threads asked why
vessel_arrivedevents arrived withlocation: null/location_locode: nulland whether to expect a later update, and whether a query parameter exists to fetch only terminal-related transport events. Both behaviors are confirmed against the OpenAPI schema (location_locodeisnullable: true; the endpoint defines nofilterparameter) but were not stated on the relevant pages.Greptile Summary
This documentation-only PR closes two recurring gaps surfaced by assistant conversations: explaining when
location_locodeis null on transport events, and clarifying thatGET /containers/{id}/transport_eventshas no server-side filtering.event-timestamps.mdx: Adds a new section describing the three reasonslocation_locode(andlocation) may be null, confirms the value is never back-filled on the original event, and cross-links to the existing null-timezone section.get-a-containers-transport-events.mdx: Adds a prose paragraph stating the endpoint returns the full event history with no filter query parameters, advises client-side filtering onattributes.eventorattributes.data_source, and links to the event timestamps guide.Confidence Score: 4/5
Safe to merge — both files are documentation only with no runtime impact.
The additions are accurate and well-targeted. The one substantive concern is in the transport events reference page, where filtering by
attributes.eventand filtering byattributes.data_sourceare presented as interchangeable approaches for the same "terminal-only events" goal — but events likevessel_arrivedcan originate from carrier data sources, so adata_source == "terminal"filter would silently miss them. This could lead developers down an incorrect implementation path. Theevent-timestamps.mdxadditions are clear and correct.The filtering guidance in
get-a-containers-transport-events.mdxwarrants a second look to ensure theattributes.eventandattributes.data_sourcestrategies are described as distinct tools rather than equivalent alternatives.Important Files Changed
vessel_arrivedandvessel_berthedcoverage.location_locodeandlocation, with accurate reasoning for nulls and a correct cross-reference to the null-timezone section; minor grammatical nit in the opening sentence.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["GET /containers/{id}/transport_events"] --> B["Returns full event history\n(no server-side filter params)"] B --> C{Client-side filtering} C -->|by event name| D["attributes.event\ne.g. 'vessel_arrived', 'full_in'"] C -->|by data source| E["attributes.data_source\ne.g. 'terminal', 'carrier'"] B --> F{location_locode?} F -->|not null| G["Use for timezone conversion\n(see Event Timestamps guide)"] F -->|null| H["Location unknown\nDo NOT wait for back-fill"] H --> I["timezone is also typically null\nTimestamp stored as-given in UTC"] H --> J["A new actual event will arrive\nif carrier later provides location"]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A["GET /containers/{id}/transport_events"] --> B["Returns full event history\n(no server-side filter params)"] B --> C{Client-side filtering} C -->|by event name| D["attributes.event\ne.g. 'vessel_arrived', 'full_in'"] C -->|by data source| E["attributes.data_source\ne.g. 'terminal', 'carrier'"] B --> F{location_locode?} F -->|not null| G["Use for timezone conversion\n(see Event Timestamps guide)"] F -->|null| H["Location unknown\nDo NOT wait for back-fill"] H --> I["timezone is also typically null\nTimestamp stored as-given in UTC"] H --> J["A new actual event will arrive\nif carrier later provides location"]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "docs: clarify null event locations and t..." | Re-trigger Greptile