Logs: BeforeLogs Sync with Native
@lucas-zimerman is already working on this.
Since Sep 10, 2025.
Assessment
This issue has not been assessed yet.
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
beforeLogsthat 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
beforelogon 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_captureSerializedLogthat could be used to skip the log processing on the JavaScript SDK, but doesn't expose a way of convertingLogtoserializedLog, requiring code duplication.
Solution 2:
- When
beforeLogis called on the native layer, call the JavaScriptbeforeLogwith 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.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 367
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 94
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-react-native
-
React-Native
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-react-native#6759 · 1 comment ·
-
React-Native Replays Task
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
getsentry/sentry-react-native#6680 · 1 comment ·
-
Improvement React-Native
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-react-native#6143 · 2 comments ·
-
React-Native Task User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
getsentry/sentry-react-native#5932 · 2 comments ·
-
React-Native Replays Task
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
getsentry/sentry-react-native#5882 · 1 comment ·
All issues in getsentry/sentry-react-native
Similar issues
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/models.dev#7701 ·