Mobile replay: no way to scrub network request and response bodies before they are sent
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Versions
@sentry/react-native 8.30.0, @sentry/core 10.76.0, sentry-cocoa 9.30.1 (bundled), React Native 0.86.3, Expo 57.
What's missing
mobileReplayIntegration can capture request and response bodies for the replay Network tab (networkDetailAllowUrls, networkCaptureBodies). There is no way for the app to scrub those bodies before they leave the device. The only control is networkDetailDenyUrls, which drops the whole body of an endpoint.
beforeBreadcrumb can't be used for this:
- the bodies are attached in the
beforeAddBreadcrumbhook, which runs afterbeforeBreadcrumb - for
fetchresponses (blob bodies) the enriched breadcrumb is sent to native later throughsyncBreadcrumbToNative, which skips every hook
So an app that wants bodies, minus a token or card field, has to choose between leaking the field and losing the whole body. Server-side data scrubbing is best effort and runs after the data has already left the device.
The web replay has the same capture options plus hooks to scrub recording data before it's sent, so this is a gap on mobile.
What we did
We added an option to mobileReplayIntegration that takes a function. Each captured request or response body is parsed as JSON when possible, passed through the function, and the result is what gets sent. We pass the same redaction function we use in beforeSend, so a body loses the same fields an error event would.
One edge case: a body over the 150 KB limit is truncated, and a truncated body can't be reliably parsed and scrubbed. When the option is set, we drop such a body entirely (keeping the size warning) instead of sending it unscrubbed.
It would be great to have an official option like this, or any hook that runs on the final network details for both the synchronous and the async (blob) path.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1.8k
- Forks
- 371
- Ø Merge
- 22 Std. 3 Min.
- Gemergte PRs (30 T.)
- 106
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getsentry/sentry-react-native
-
React-Native
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
getsentry/sentry-react-native#7073 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Improvement React-Native
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
getsentry/sentry-react-native#7055 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
React-Native Replays Task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
getsentry/sentry-react-native#6680 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Improvement React-Native
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
getsentry/sentry-react-native#6143 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
React-Native Task User Feedbacks
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
getsentry/sentry-react-native#5932 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in getsentry/sentry-react-native
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
mckinsey/agents-at-scale-ark#4091 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
factory:subtask
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
NUS-Project-SaBai/project-sabai#386 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
android needs clarification
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
super-productivity/super-productivity#12105 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag