Support runtime environment changes via scope (sync to native Scope.setEnvironment)

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

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
android, ios, javascript, react-native, typescript

調査の方向性

This work is parked until @sentry/core gains a scope-level setEnvironment API. First check the linked sentry-javascript proposal and implementation status; if the API exists, trace the scope-sync path on Android and iOS for both architectures, including the bridge spec and its older-binary fallback. Done means runtime environment changes reach native events, logs, and profiles on both platforms.

索引モデルが issue の本文から書いたものです。

説明

React-Native
Context

sentry-java 8.63.0 added Scope.setEnvironment/getEnvironment (sentry-java#5772, proposal sentry-java#5769). It is applied to events, the DSC, logs, metrics and profiles. sentry-cocoa already has -[SentryScope setEnvironment:], and sentry-native has sentry_set_environment.

Problem

In RN, environment can only be set at init (options.environment). That value goes to native once, in RNSentryStart and on iOS. If an app changes environment at runtime, native-captured events (native crashes, ANRs, app-exit/NDK events, native logs and profiles) keep the init-time value.

Blocker

JS @sentry/core's Scope has no environment API, so there's nothing on the JS side to sync over the bridge.

Proposal
  1. Upstream: ask sentry-javascript for a scope-level setEnvironment (or find out whether they plan one).
  2. Once that exists: sync it to native through the scope-sync path on both platforms (Android Scope.setEnvironment, iOS SentryScope setEnvironment:), on both architectures. This adds a bridge spec method, so it needs a fallback for older native binaries.

Until then, this is parked.

主要言語
TypeScript
スター
1.8k
フォーク
371
平均マージ
22時間 3分
マージ済み PR(30日)
106

環境構築

はじめの一歩

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

getsentry/sentry-react-native のほかの issue

getsentry/sentry-react-native の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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