Skip to content

fix(api)!: each binary datapoint refusal has the type its status calls for - #120

Merged
olavgg merged 1 commit into
mainfrom
errors/9-binary-problem-types
Sep 17, 2026
Merged

olavgg merged 1 commit into
mainfrom
errors/9-binary-problem-types

Conversation

@JosteinGj

@JosteinGj JosteinGj commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What

Every refusal on POST /timeseries/data/binary had the type datapoint-block-rejected, whether it answered 400, 404, 413, 415, 422 or 429. RFC 9457 §4 says a problem type documents the one status it is used with, so each status now gets its own type:

Status Type reason values
400 invalid-frame the 13 frame-format reasons (unsorted, schema-mismatch, …)
404 unknown-timeseries unknown-timeseries
413 request-too-large (existing) frame-too-large, too-many-frames, request-too-large
415 unsupported-media-type (existing) unsupported-content-encoding
422 value-type-mismatch / external-id-mismatch same as the type
429 too-many-in-flight too-many-in-flight
  • Unchanged: reason, frameIndex, timeseriesIds and every status stay as they were.
  • Reused types: the 413s use request-too-large, the type the size-limit filter already sends for an oversized body on this same endpoint. The 415 uses the same type as a wrong Content-Type.
  • Titles: each title now describes its type.
  • Retry: too-many-in-flight is explicitly retry: same-request instead of being derived from the status.
  • Schema: the endpoint's error responses name a new DatapointBlockProblem schema, ApiProblem lists the new types, and a test fails if any type constant in Problems is missing from that list.

Compatibility

This breaks anything matching type == ".../datapoint-block-rejected". I found no code that does. The Java SDK (BinaryDatapointIngestor) and the Rust SDK (src/timeseries/binary.rs) check the status plus the substring unknown-timeseries or external-id-mismatch in the body. Both strings are still in reason, and each is now also its type's slug.

Docs (datahub-sdk-docs)

Updated in IntelliStream-DataHub/datahub-sdk-docs#80, to merge after this ships:

  • reference/binary-datapoints.md: §Responses (example, table with a type column) and the §Caps row for the compressed body.
  • reference/limits.md: summary table, §Request body size, §Binary frame caps. §Request body size already said a raw oversized body got datapoint-block-rejected; the filter has always sent request-too-large, so that is fixed there too.
  • reference/client.md: the binary row of the status table.

reference/timeseries.md and the SDK-behaviour table in limits.md use only reason strings and stay true.

Suggested doc pages for the new types, if type URIs are made to resolve:

  • invalid-frame, value-type-mismatchbinary-datapoints#responses
  • unknown-timeseries, external-id-mismatchbinary-datapoints#retrying
  • too-many-in-flightlimits#binary-frames

This is one of four independent problem-type PRs (binary, file restore, file path collisions, upload 403). They merge cleanly with each other in any order. ./gradlew :datahub-api:test passes.

🤖 Generated with Claude Code

…s for

Every refusal on POST /timeseries/data/binary was datapoint-block-rejected,
answering 400, 404, 413, 415, 422 or 429 depending on its reason. RFC 9457
gives a type one status, so each now has its own: invalid-frame,
unknown-timeseries, value-type-mismatch, external-id-mismatch and
too-many-in-flight, plus the existing request-too-large and
unsupported-media-type. `reason` stays, which is what the Java and Rust SDKs
match on.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@olavgg
olavgg merged commit 0a3f4b9 into main Sep 17, 2026
7 of 9 checks passed
@olavgg
olavgg deleted the errors/9-binary-problem-types branch September 17, 2026 12:41
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