Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/contributing/api-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,12 @@ Retries are:
Callers and tools need no changes: a retried request either resolves normally or
throws the same error it would have thrown without retries.

The CLI's transport (`packages/cli/src/lib/sentry-client.ts`) follows the same
shared rule. Only the caps differ (`RETRY_POLICY`): the hosted MCP keeps its
total wait short so a Workers request isn't held open, while the CLI can wait
longer. The CLI also applies its own per-request timeout, which counts as a
network failure.
The CLI sends its requests through the shared transport in
`@sentry/toolkit-core/api-transport`, configured in
`packages/cli/src/lib/sentry-client.ts`. It follows the same shared rule; only
the caps differ (`RETRY_POLICY`): the hosted MCP keeps its total wait short so
a Workers request isn't held open, while the CLI can wait longer. The CLI also
applies its own per-request timeout, which counts as a network failure.

## Best Practices

Expand Down
19 changes: 3 additions & 16 deletions packages/cli/src/lib/fetch-input.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/**
* Helpers for the `input` argument of `fetch()`.
* Helpers for the `input` argument of `fetch()`. The transport owns the
* implementation; this path stays for CLI callers and tests.
*/

/**
* Extract the full URL string from a fetch input.
*
* `String(request)` yields `"[object Request]"`, so `Request` inputs need
* their `.url` read explicitly.
*/
export function extractInputUrl(input: Request | string | URL): string {
if (typeof input === "string") {
return input;
}
if (input instanceof URL) {
return input.href;
}
return input.url;
}
export { extractInputUrl } from "@sentry/toolkit-core/api-transport";
Loading
Loading