Skip to content

docs(android): give ReportHandler its own page - #68

Merged
krassx merged 1 commit into
mainfrom
docs/android-report-handler-page
Sep 29, 2026
Merged

krassx merged 1 commit into
mainfrom
docs/android-report-handler-page

Conversation

@krassx

@krassx krassx commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

setReportHandler was covered in two places — a long section inside Manual reporting → Bug reporting, and most of the Privacy → Report page. That buried an API which applies to every report, not just manually filed ones, and left two copies to drift apart.

What moved

New top-level Android page: Report handler, placed in the nav directly after the Manual reporting category — top level rather than inside it, because the handler runs for crashes, handled errors, silent uploads and bug reports alike.

  • Bug reporting keeps the ## Customize reports with ReportHandler heading (so existing links still land) and now points at the new page.
  • Privacy and report fields keeps its scrubbing angle and example, and defers the contract instead of restating it.
  • Crash & error reporting and docs/index.md relinked.

Two things the old text never said

Both from BugseeIssueReportingCoordinator, and both affect whether a handler is correct:

  1. Non-terminating callbacks run on the main thread (invokeHandlerAsync → runOnMainThread). The existing examples had readers calling openStream() and writing a config snapshot right there — file I/O on the UI thread, with a 30-second budget behind it. The page now states the thread and shows the background-thread form, which works precisely because the pipeline waits for completionCallback.

  2. The terminating path differs in every respect worth knowing. It runs on an already-alive background thread, is capped at a few seconds (TERMINATING_HANDLER_CAP_MILLIS), completionCallback no longer gates anything, work scheduled for later is lost with the process, and ReportHandlerCallbackTimeout does not apply. The examples now branch on isTerminating first.

Also newly documented: a handler that throws is caught and logged, and the pipeline advances so the report still ships.

The attachment quota

I dropped the "3 attachments × 3 MB" line rather than carrying it into the canonical page. Those are 6.x figures from AttachmentsHelper, which no longer exists at that path in 7.x. The only cap I can find in the 7.x source is a soft 1000-attachment ceiling in IssueReport.createAndAddAttachment, which logs a warning and returns an attachment that is not added to the report — that is what the page now documents, along with advice to keep attachments small.

I could not find a size limit in the SDK or in the appserver config. If one is enforced server-side, it should go back in with a source — flagging rather than guessing, since the old number may simply have been stale. The same claim still appears in migration.mdx; I left it there because that page is describing the 6.x→7.x transition, but it is worth a second look.

Verification

  • npx cspell — 294 files, 0 issues.
  • npm run build — zero broken links and zero broken anchors. The move initially broke two #attachments references (one on the home page, one inside bug-reporting.mdx); both are retargeted, and the rebuild is clean. Worth noting this repo sets onBrokenAnchors: 'warn', so those would not have failed CI — I checked the warning output.
  • Confirmed in the built output that the new page renders with its #attachments anchor and that "Report handler" appears in the Android sidebar.

🤖 Generated with Claude Code

The API was covered in two places — a long section inside Manual reporting →
Bug reporting, and most of the Privacy → Report page — which buried an API
that applies to every report, not just manually filed ones, and meant two
copies drifting apart.

Moved to docs/sdk/android/report-handler.mdx, a top-level entry in the
Android nav next to Manual reporting. Bug reporting keeps the heading and
points at it; the privacy page keeps its scrubbing angle and defers the
contract.

Two things the previous text did not say, both taken from
BugseeIssueReportingCoordinator:

- Non-terminating callbacks run on the MAIN thread. The examples had callers
  doing file I/O there with a 30 s budget. The page now says so and shows the
  background-thread form, which works because the pipeline waits for
  completionCallback.
- The terminating path differs in every respect worth knowing: background
  thread, a few seconds' cap, completionCallback no longer gating anything,
  scheduled work lost, and the timeout option not applying. Also documented
  that a throwing handler is caught and logged so the report still ships.

Dropped the "3 attachments × 3 MB" quota rather than carrying it over. Those
are 6.x numbers from AttachmentsHelper, which no longer exists at that path;
the only cap in the 7.x source is a soft 1000-attachment ceiling in
IssueReport, which is what the page now states. If a size limit is enforced
server-side, it should be documented with a source.

Retargeted the #attachments anchor references on docs/index.md and within
bug-reporting.mdx, which the move would otherwise have broken.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Change-Id: Iaabe9d35aec2bfc19dc94c868dfa057a632fff50
@krassx
krassx merged commit 29a3059 into main Sep 29, 2026
1 check passed
@krassx
krassx deleted the docs/android-report-handler-page branch September 29, 2026 14:22
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