Skip to content

Fix for mutable config#179

Merged
waltjones merged 2 commits into
rollbar:masterfrom
jbennett:master
Sep 26, 2023
Merged

Fix for mutable config#179
waltjones merged 2 commits into
rollbar:masterfrom
jbennett:master

Conversation

@jbennett

@jbennett jbennett commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

When making changes to the configuration (setting access token, changing user etc), a non-mutable config is used.

This change calls mutableCopy on the RollbarConfig instead of just casting it to a RollbarMutableConfig.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Related issues

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

This was just casting to a RollbarMutableConfig, but it wasn’t actually mutable. This makes the config actually mutable
Comment thread ios/RollbarReactNative.m
RollbarMutableConfig *config = ((RollbarMutableConfig *)[Rollbar configuration]);
RollbarMutableConfig *config = [[Rollbar configuration] mutableCopy];
if (config) {
updateConfiguration(config, options);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've run into the same issue following the Rollbar setup docs. Thank you for tackling this!

If I'm following the code path correctly here, is it possible that you need to add a call to

[Rollbar updateWithConfiguration:config];

after this? It seems like updateConfiguration(...) here is updating the mutable copy of the configuration, but not actually applying the changes in that copy to Rollbar.

@brianr

brianr commented Sep 25, 2023

Copy link
Copy Markdown
Member

Thank you @jbennett and @jgregory-apogee! We'll get this reviewed.

@waltjones waltjones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbennett , @jgregory-apogee thank you for the fix!

@waltjones waltjones merged commit aac0ec0 into rollbar:master Sep 26, 2023
@waltjones

Copy link
Copy Markdown
Contributor

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants