getsentry / getsentry/sentry-react-native

Logs: BeforeLogs Sync with Native

オープン
#5,158 コメント 7 件 リアクション 1 件 担当者 1 名 GitHub で見る

@lucas-zimerman がすでに取り組んでいます。

2025年9月10日 から。

Improvement Logs React-Native
主要言語
TypeScript
スター
1.8k
フォーク
367
平均マージ
1日 6時間
マージ済み PR(30日)
94

説明

### 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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。