fix(crashes): send xcode-metrics Accept header for perfPowerMetrics - #23
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
App Store Connect's
perfPowerMetricsendpoint rejectsAccept: application/jsonwith a 406 Not Acceptable and requiresAccept: application/vnd.apple.xcode-metrics+json.opdev crashes diagnosewas sending JSON for every endpoint, so the metrics fetch always 406'd.This adds
ascGetAccept— a variant ofascGetthat takes a caller-suppliedAcceptheader — and uses it for theperfPowerMetricsrequest only. Every other endpoint keepsapplication/json.Verified
go test ./crashes/green;go vet ./crashes/clean.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:
perfPowerMetricsis 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).opdev crashescan surface aggregate metrics and tester feedback notes, but not those Organizer-only symbolicated reports.I drafted a
betaFeedbackCrashSubmissionsfetch 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