Skip to content

Merge an app exit report and the Android SDK native record of one crash (SDK 0.13.2) - #969

Merged
stamp-build[bot] merged 2 commits into
mainfrom
volta/crash-submission-merge
Nov 17, 2026
Merged

stamp-build[bot] merged 2 commits into
mainfrom
volta/crash-submission-merge

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Volta from botiverse opened this pull request through Stamp
View in Stamp →


Problem

An Android app that reports its own process exits (from ApplicationExitInfo) and the SDK's native crash record of the same process got two tickets for one crash. Hands already keeps one ticket per submission_id, but the SDK never sent one, and a second report with different content under the same id was rejected with 409, so whichever side arrived second lost its evidence. If the exit report arrived first it could be auto-closed as a background system kill, burying a real native crash.

Changes

Server (POST /public/v2/apps/:slug/feedback):

  • Two different crash/error reports under one explicit submission_id merge into the first ticket when exactly one is an SDK native crash record, or both are the same native record resent. Every other pairing still gets 409.
  • The native side decides the classification fields and the grouping signature. Other fields from both sides are kept, and the losing side's differing values go into crash_merge metadata.
  • Attachments are appended without duplicates; the native record and tombstone may exceed the ticket limit by two, and dropped names are recorded.
  • A ticket auto-closed as a background kill reopens and gets its crash alerts (scheduleCrashAlerts, extracted unchanged from the submit path) plus feedback:new.
  • Native frames that arrive by merge are symbolicated.
  • Resending the same merge changes nothing; a ticket accepts at most five changing merges; anonymous callers never learn the ticket id.

Android SDK 0.13.2:

  • HandsFeedback.submit(..., submissionId) and submitReport(...), which also reports whether the submission was merged.
  • HandsNativeCrash.processEventId (random UUID per process) and processStartAt, written into each native crash record by the signal handler and used as its submission_id.
  • HandsNativeCrash.uploadPending returns one NativeCrashUpload per record (UPLOADED, MERGED, FAILED_WILL_RETRY, DISCARDED) with pid, process start time, event id, crash time and matched exit timestamp.

Docs: Android SDK guide and public API reference (en/zh).

Follow-up

  • Hands.install discards the per-record results; apps that need them call HandsNativeCrash.uploadPending directly.
  • A merge that loses the optimistic metadata race answers 503 after its attachments were already added; the retry converges.

Testing

  • worker: full vitest suite passes, apart from one installer test that also fails on main on this machine (macOS shasum shell). New tests cover both arrival orders: final signature, classification, status/reopen, crash_merge conflicts, attachments, webhook events, idempotent resends, a planted crash_merge, and rejected pairings. tsc --noEmit is clean.
  • Android: new unit tests for record parsing (process identity, malformed ids, legacy records), submission responses (merged with and without id), and the id pattern; run by the Android SDK check in CI (no local Android toolchain).

🤖 Generated with Claude Code

Volta and others added 2 commits November 17, 2026 18:43
… one crash

Hands kept one ticket per submission_id but rejected a second, different
report under it. An Android app that reports its own process exits and the
SDK's native crash record of the same process therefore produced two tickets,
or lost one side's evidence.

Server: two different crash/error reports under one explicit submission_id
merge into the first ticket when exactly one is the SDK native record (or
both are the same native record resent). Native evidence decides
classification and signature, other fields from both sides are kept, losing
values are recorded under crash_merge, attachments are appended without
duplicates, an auto-closed background-kill ticket reopens and its crash
alerts fire.

Android SDK 0.13.2: HandsFeedback.submit/submitReport accept submissionId;
native records carry a per-process processEventId and processStartAt and
upload under that id; HandsNativeCrash.uploadPending returns one result per
record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Volta <botiverse+volta@agents.stamp.build>
… bounded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Volta <botiverse+volta@agents.stamp.build>
@stamp-build
stamp-build Bot merged commit 5e2565d into main Nov 17, 2026
14 checks passed
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.

0 participants