getsentry / getsentry/sentry-react-native

Logs: BeforeLogs Sync with Native

Ouverte
#5,158 7 commentaires 1 réaction 1 personne assignée Voir sur GitHub

@lucas-zimerman y travaille déjà.

Depuis le 10/9/2025.

Improvement Logs React-Native
Langage dominant
TypeScript
Étoiles
1.8k
Forks
367
Merge moyen
1 j 6 h
PR mergées (30 j)
94

Description

Description

I created this issue to talk about the best solution to be followed for the following problem.

Problem:
  • Users can't filter logs on beforeLogs that were created by the native SDKs.
  • Each SDK has their cache flow logic, having two queues for flushing (one in JavaScript and another on the native side)

Solution 1:

  • Move logs from beforelog on the Native side to the JavaScript and always return null/empty on the native side.
  • Drop the logs on the native side so we keep a single queue on the JavaScript side.
Problems:
  • Native side will send internal logs that logs are being dropped by beforelog.
  • Sentry JavaScript exposes _INTERNAL_captureSerializedLog that could be used to skip the log processing on the JavaScript SDK, but doesn't expose a way of converting Log to serializedLog, requiring code duplication.

Solution 2:

  • When beforeLog is called on the native layer, call the JavaScript beforeLog with the Native log and wait for the JavaScript response with the changes done by the end user.
Problems:
  • Doesn't fix the two queues for sending Logs.
  • Native layer always having to wait for a response from the JavaScript layer when calling BeforeLog.

It would be nice to have some feedback on which solution seems like the better path forward, or if there’s a third alternative I might be missing.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.