Skip to content

fix(crashes): send xcode-metrics Accept header for perfPowerMetrics - #23

Merged
tonyferrell merged 1 commit into
mainfrom
fix/crashes-perfpowermetrics-accept
Jun 5, 2026
Merged

fix(crashes): send xcode-metrics Accept header for perfPowerMetrics#23
tonyferrell merged 1 commit into
mainfrom
fix/crashes-perfpowermetrics-accept

Conversation

@tonyferrell

Copy link
Copy Markdown
Contributor

What

App Store Connect's perfPowerMetrics endpoint rejects Accept: application/json with a 406 Not Acceptable and requires Accept: application/vnd.apple.xcode-metrics+json. opdev crashes diagnose was sending JSON for every endpoint, so the metrics fetch always 406'd.

This adds ascGetAccept — a variant of ascGet that takes a caller-supplied Accept header — and uses it for the perfPowerMetrics request only. Every other endpoint keeps application/json.

Verified

  • go test ./crashes/ green; go vet ./crashes/ clean.
  • Reproduced the 406 against the live ASC API for build of app 6761599179; the xcode-metrics Accept header resolves it.

Honest limitations (not addressed here)

While testing the live crash-diagnosis path against a real reported crash, I confirmed two API realities worth recording:

  • perfPowerMetrics is aggregate-only. It returns rolled-up power/performance metric histograms, not individual crash reports. For a build with no aggregated data yet it returns 404 (already swallowed with a warning).
  • Xcode Organizer "Share with App Developers" crashes are not exposed by the public ASC API. The crash a tester shares via the Organizer flow is not retrievable through any documented App Store Connect endpoint. opdev crashes can surface aggregate metrics and tester feedback notes, but not those Organizer-only symbolicated reports.

I drafted a betaFeedbackCrashSubmissions fetch for tester-submitted crash feedback but dropped it from this PR: it returned 404 for the build under test (no tester submissions) and was unverified, so it stays out until we have a real submission to validate against.

🤖 Generated with Claude Code

App Store Connect's perfPowerMetrics endpoint rejects "application/json"
with a 406 and requires "application/vnd.apple.xcode-metrics+json". Add
ascGetAccept (a caller-supplied-Accept variant of ascGet) and use it for
the perfPowerMetrics fetch; all other endpoints keep JSON.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tonyferrell
tonyferrell merged commit 45c3329 into main Jun 5, 2026
1 check passed
@tonyferrell
tonyferrell deleted the fix/crashes-perfpowermetrics-accept branch June 5, 2026 06:24
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.

1 participant