Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sessions sent without an environment when environment option is not set #2411

Closed
Tracked by #73
kerenkhatiwada opened this issue Nov 18, 2022 · 1 comment · Fixed by #2447
Closed
Tracked by #73

sessions sent without an environment when environment option is not set #2411

kerenkhatiwada opened this issue Nov 18, 2022 · 1 comment · Fixed by #2447
Assignees
Milestone

Comments

@kerenkhatiwada
Copy link
Member

Description

If the environment is not set for the SDK errors will default to production. However, sessions are sent without an environment.

Expected outcome - sessions would be sent with an environment
Actual outcome: sessions are sent without an environment set

Steps To Reproduce

  1. set the environment and release options
  2. Send an error event and session
  3. Observe that session and error event with the correct environment
  4. repeat without setting the environment option
  5. Observe the error event with an environment of production
  6. Observe the session with no environment
@kerenkhatiwada kerenkhatiwada changed the title Sessions do not default to Production sessions sent without an environment when environment option is not set Nov 18, 2022
@philipphofmann
Copy link
Member

We set the default environment for events here

if (nil == event.environment) {
// We default to environment 'production' if nothing was set
event.environment = kSentryDefaultEnvironment;
}

but not when starting the session

NSString *environment = options.environment;
if (nil != environment) {
_session.environment = environment;
}

Thanks for reporting this, @kerenkhatiwada.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants