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

Aberta
#6,991 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
android, ios, javascript, react-native, typescript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
1.8k
Forks
371
Merge médio
22h 3min
PRs com merge (30d)
106

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de getsentry/sentry-react-native

Todas as issues de getsentry/sentry-react-native

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.