Skip to content

Emit warning when stripe-notify header is present in response#7

Closed
shivampkumar wants to merge 1 commit into
mirror/pr-2219-basefrom
mirror/pr-2219
Closed

Emit warning when stripe-notify header is present in response#7
shivampkumar wants to merge 1 commit into
mirror/pr-2219-basefrom
mirror/pr-2219

Conversation

@shivampkumar

@shivampkumar shivampkumar commented Jun 11, 2026

Copy link
Copy Markdown

Why?

We've noticed a trend where users (and their agents) will sometimes reach for suboptimal API endpoints/methods because of outdated information. For example, using /v1/accounts when /v2/core/accounts is available and has a superset of the functionality from v1.

In an effort to help steer users towards best practices, we're introducing a new header to provide feedback during the development process. The SDK is responsible for surfacing this header, if present.

Once enabled internally, the header will be returned by the server for:

  • all testmode calls
  • livemode calls made by an agent

We may tweak that going forwards. But no matter the conditions, the SDKs will act as a thin pipe.

What?

  • Emit warning when we see the Stripe-Notice header in a response. Note this is the first warning we're emitting in this SDK, so make sure it's the correct way to do that!
  • add tests

See Also


Mirrored from stripe/stripe-java#2219 by xavdid for the VibeOps live demo. Real PR, real diff, reviewed by the same pipeline our customers run.

@vibeops-ai vibeops-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ VibeOps Review — No issues found. Clean PR.

🟢 Auto-approval eligible · L2 NONE · 90% confidence

💭 Heads-up · new code, no historical precedent (2)

Agent-confident findings on patterns we haven't seen reviewed before in this repo. Not blocking. Skim, ignore, or address.

**The rawRequest() method does not call maybeEmitStripeNotice(response** src/main/java/com/stripe/net/LiveStripeResponseGetter.java:226`

The rawRequest() method does not call maybeEmitStripeNotice(response.headers()) after receiving the response, even though the sibling methods request() (line 137) and requestStream() (line 182) both do. This means callers using rawRequest() — the raw/low-level API path — will silently miss any Stripe-Notice deprecation warnings that Stripe sends back in the response headers.

🔗 Backed by: agent reasoning

The rawRequest method does not call maybeEmitStripeNotice, breaking parity with request and requestStream which
src/main/java/com/stripe/net/LiveStripeResponseGetter.java:200

The rawRequest method does not call maybeEmitStripeNotice, breaking parity with request and requestStream which both emit the warning. Any caller using rawRequest will silently miss Stripe-Notice header warnings, even though the response headers are available at that point.

🔗 Backed by: agent reasoning · verifier read the file

What's good

  • Clean changeset with no findings from any reviewer.

Reviewed by VibeOps

@vibeops-ai

vibeops-ai Bot commented Jun 11, 2026

Copy link
Copy Markdown

src/main/java/com/stripe/net/LiveStripeResponseGetter.java:235

💭 Heads-up · Bug · The rawRequest() method does not call maybeEmitStripeNotice(response.headers()) after receiving the response, even though the sibling methods request() (line 137) and requestStream() (line 182) both do. This means callers using rawRequest() — the raw/low-level API path — will silently miss any Stripe-Notice deprecation warnings that Stripe sends back in the response headers.

No historical precedent in your repo — agent reasoning only. Not blocking. Skim, ignore, or address.

🔗 Backed by: agent reasoning

StripeResponse response =
      sendWithTelemetry(request, apiRequest.getUsage(), r -> httpClient.requestWithRetries(r));

  maybeEmitStripeNotice(response.headers());

  int responseCode = response.code();

Was this helpful? React with 👍 or 👎 to help VibeOps learn.

@vibeops-ai

vibeops-ai Bot commented Jun 11, 2026

Copy link
Copy Markdown

src/main/java/com/stripe/net/LiveStripeResponseGetter.java:220

💭 Heads-up · Bug · The rawRequest method does not call maybeEmitStripeNotice, breaking parity with request and requestStream which both emit the warning. Any caller using rawRequest will silently miss Stripe-Notice header warnings, even though the response headers are available at that point.

No historical precedent in your repo — agent reasoning only. Not blocking. Skim, ignore, or address.

🔗 Backed by: agent reasoning · verifier read the file

// After the sendWithTelemetry call in rawRequest, add:
maybeEmitStripeNotice(response.headers());

Was this helpful? React with 👍 or 👎 to help VibeOps learn.

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