fix(diagnostics): address round-6 review findings on PR #445

- AdminDiagnostics list: fix regression where rows dereferenced the
  now-omitted manifest for app_build. Project app_build server-side out
  of manifest JSONB into both list and detail responses (cheap
  COALESCE(manifest->'report'->>'app_build','')), split the TS type into
  DiagnosticReportSummary (list, no manifest) and DiagnosticReport
  (detail, with manifest), and read report.app_build in the row/detail.
- embeddedManifestMatches: decode with json.Decoder + UseNumber so large
  integers above 2^53 (e.g. log_summary.lines) can't collapse to the same
  float and falsely match; re-assert no-trailing-data strictness.
- Quota reservation (SKIP): reserving the client-claimed archive.bytes is
  sound because archiveMatches requires claimed==actual before MarkReady,
  so no stored report exceeds its reservation; documented in a code comment.
- Multipart parts: reject a wrong-name/wrong-content-type part without
  calling part.Close(), which would drain up to the bundle limit while
  holding the in-flight slot; abandon it so malformed uploads fail promptly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012e3QjbPo96ed9Mn2qRiUkh
This commit is contained in:
Quick104
2026-07-21 14:23:59 -04:00
co-authored by Claude Fable 5
parent dee46f9398
commit 9fad08a6fa
9 changed files with 148 additions and 25 deletions
+12 -3
View File
@@ -2554,7 +2554,10 @@ export interface ClientDiagnosticManifest {
[key: string]: unknown;
}
export interface DiagnosticReport {
// DiagnosticReportSummary is the shape returned by the admin list endpoint,
// which omits the full manifest JSONB for cheap paging. `app_build` is projected
// out of the manifest server-side so rows can still show the build number.
export interface DiagnosticReportSummary {
id: string;
short_id: string;
user_id: number;
@@ -2565,8 +2568,8 @@ export interface DiagnosticReport {
report_type: DiagnosticReportType;
platform: DiagnosticPlatform;
app_version: string;
app_build: string;
crash_summary?: string;
manifest: ClientDiagnosticManifest;
playback_session_ids: string[];
blob_bucket?: string;
blob_key?: string;
@@ -2575,8 +2578,14 @@ export interface DiagnosticReport {
blob_sha256?: string;
}
// DiagnosticReport is the full detail shape (GetByID), which additionally
// includes the parsed manifest for the detail pane.
export interface DiagnosticReport extends DiagnosticReportSummary {
manifest: ClientDiagnosticManifest;
}
export interface DiagnosticReportListResponse {
reports: DiagnosticReport[];
reports: DiagnosticReportSummary[];
next_cursor?: string;
}