Skip to content

fix(binary): read the stale-series retry from the typed problem - #134

Merged
olavgg merged 1 commit into
mainfrom
fix/binary-stale-series-typed-problems
Sep 18, 2026
Merged

olavgg merged 1 commit into
mainfrom
fix/binary-stale-series-typed-problems

Conversation

@JosteinGj

Copy link
Copy Markdown
Contributor

Replaces #131, which was opened six hours before the api changed under it.

What

is_stale_series_rejection searched the raw response body for unknown-timeseries or
external-id-mismatch, the idiom from before ResponseError::problem() existed. That also
matched the SDK's own pre-flight 404, which names the series it could not resolve, so an
external id spelling one of those tokens earned a pointless second attempt.

It reads the problem type now. Platform #120
(b3412ec0) gave each binary refusal the type its status calls for, so the slug discriminates
here the way it does on every other endpoint:

Slug Status Retried?
invalid-frame 400 no
unknown-timeseries 404 yes
request-too-large 413 no
unsupported-media-type 415 no
value-type-mismatch 422 no
external-id-mismatch 422 yes
too-many-in-flight 429 by post_frames, as before

The single datapoint-block-rejected that preceded them is deliberately not matched, and a
test says so: the binary path has never been in a release, so nothing can be sending it to a
caller of this SDK. reason survives server-side as the kebab-case sub-case and is what tells
the thirteen malformed-frame cases apart, but it is no longer the discriminator.

Why #131 could not just be merged

It gated on problem.slug() == Some("datapoint-block-rejected"), a slug the api no longer
emits, so merging it would have silently disabled the retry rather than fixed it. Its unit
test passed only because the fixtures hand-built the old body.

Verification

  • only_a_stale_series_problem_rebuilds_the_request passes offline. Four cases, two of them
    negative on purpose: value-type-mismatch (re-resolving cannot make a value fit) and the
    retired datapoint-block-rejected, so a future compat fallback has to delete a test to land.
  • test_insert_datapoints_binary_re_resolves_a_recreated_series is the first live coverage of
    the retry at all: every other path resolves before it sends. It is #[ignore]d next to
    test_datapoints_binary and needs a backend at platform test(python): POLICY type-labels are matchable now #120 or later — on an older one
    it fails with the pre-split body, which is the correct report, not a flake.
  • CI here is cargo test --no-run, so green checks mean it compiles. They did on fix(binary): decide the stale-series retry from the problem document #131 too.

Notes for the reviewer

  • Docs for the api-side split are already up as datahub-sdk-docs
    #80.
  • The AGENTS.md hunk touches the same paragraph as docs/sync-with-sdk, so whichever lands
    second takes a small conflict. That branch also drops the stale "Not in the Python bindings
    yet" sentence, left alone here on purpose.

🤖 Generated with Claude Code

is_stale_series_rejection searched the raw body for "unknown-timeseries"
or "external-id-mismatch", the idiom from before ResponseError::problem()
existed. That also matched the SDK's own pre-flight 404, which names the
series it could not resolve, so an external id spelling one of those
tokens earned a pointless second attempt.

It reads the problem type now. Platform #120 gave each binary refusal the
type its status calls for, so the slug discriminates here the way it does
on every other endpoint: unknown-timeseries and external-id-mismatch are
the two that a re-resolve can fix. The single datapoint-block-rejected
that preceded them is deliberately not matched, and a test says so: the
binary path has never been in a release, so nothing can be sending it.

The retry had no live coverage because the SDK resolves every series
before sending. test_insert_datapoints_binary_re_resolves_a_recreated_series
deletes and recreates a series under the same external id, so the server
refuses the cached id. It needs a backend at platform #120 or later, hence
the #[ignore], next to test_datapoints_binary which needs the endpoint at
all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: jgjesdal <jostein@intellistream.ai>
@JosteinGj
JosteinGj requested a review from olavgg September 18, 2026 11:59
@olavgg
olavgg merged commit d6a2c69 into main Sep 18, 2026
18 checks passed
@olavgg
olavgg deleted the fix/binary-stale-series-typed-problems branch September 18, 2026 14:05
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