Simplify debug report snapshots#285
Draft
soamdesai-tfh wants to merge 15 commits into
Draft
Conversation
Simplify the debug report and tighten its handling per review: - Capture the bridge response (create + poll) alongside the request via a new debug_response_payload on BridgeConnection, exposed through WASM as debugResponsePayload and surfaced as report.response_payload. - Stop threading the request payload into every bridge error: remove the Error::BridgeRequestFailed variant and the unconditional debugPayload attachment at the WASM boundary. The payload is now obtained at a single isDebug()-gated point (getBridgeDebugPayload), closing the off-state leak. - Flatten IDKitDebugReport to the loose v1 shape (version, package_version, timestamps, transport: bridge|mini_app, request/response payloads, mini_app from window.WorldApp); drop sha256 fingerprinting and the curated native log helpers. - Update the report on timeout/cancelled poll-loop exits for both bridge and invite-code paths. Follow-up hardening: - getDebugReport() short-circuits on !isDebug() so disabling debug stops stored-proof egress. - "failed" poll status only stamps response_received_at when a poll response actually arrived (matches the exception path). - Omit the rebuilt, non-correlatable proof_request.id from creation-error reports while keeping the real id on the live path. - Fix cloneValue JSON fallback to use "null" instead of invalid "undefined". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Drop the curated `request` summary object (mode/app_id/action/environment/ return_to/flags), the IDKitDebugRequestMode type, and requestModeFromConfig; every field is already carried by request_payload. - Guard getWasmDebugPayload/getWasmDebugResponsePayload behind isDebug() so debugPayload()/debugResponsePayload() no longer run on the default-off path (previously fired once per poll for all users). - Capture the HTTP status on a failed bridge poll instead of collapsing every non-2xx into connection_failed; surfaces at response_payload.poll.http_status. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A failed bridge POST /request previously folded the HTTP status and body into
an opaque error message string, leaving the report's response side unstructured
on the creation path (unlike the poll path, which now carries http_status).
Add an Error::BridgeRequestFailed { status, body } variant; the WASM boundary
attaches the namespaced { create: { http_status, body } } object as a single
debugResponsePayload property on the JS error, and request.ts lifts it as-is
into response_payload.create. This mirrors the existing create/poll namespacing
(bridge.rs success path + poll fix) and keeps the bridge-specific shape defined
in Rust rather than reconstructed in TS.
Raw body is stored (no "no error details" placeholder) so the structured field
is truthful: an empty body is reported as empty.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Restore the three console.debug calls in the native transport to their original full-payload form, per review feedback to avoid changing the existing logging. The full request/response payloads remain available through the structured debug report (getDebugReport), so no debug data is lost. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Validation
Replaces fork PR #282 with an upstream branch PR for cleaner permissions/CI.