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

Remote configuration is polled for despite ignore_environments #679

Closed
ghiculescu opened this issue Mar 21, 2022 · 1 comment · Fixed by #685
Closed

Remote configuration is polled for despite ignore_environments #679

ghiculescu opened this issue Mar 21, 2022 · 1 comment · Fixed by #685

Comments

@ghiculescu
Copy link

ghiculescu commented Mar 21, 2022

Airbrake.configure do |c|
  c.environment = "development" # Rails.env
  c.ignore_environments = ["development", "test"]
end

If you open a Rails console or Rails server and use a gem like https://github.com/martinbtt/net-http-spy you will periodically see requests like this:

starting SSL for notifier-configs.airbrake.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "GET /2020-06-18/config/116296/config.json

I see that since #636 you can set remote_config: false but then it doesn't work anywhere, or you can do something like remote_config: ["development", "test"].include?(Rails.env.to_s) but then you're duplicating config. Either way the readme vaguely advises against this - "it is not recommended to disable this feature. It might negatively impact how your notifier works. Please use this option with caution.".

Would you accept a PR that changes

return if @config.environment == 'test'
to instead check ignore_environments?

(If no that's fine, I figure logging this here will help anyone else who gets confused by this :))

@kyrylo
Copy link
Contributor

kyrylo commented Mar 28, 2022

Let's keep test hardcoded there. In 100% of cases, we don't want that call to happen while people test their libraries. By default, ignore_environments is empty, and therefore it might force everyone to configure it just because of this pesky HTTP call. I would accept a PR that takes ignore environments into account but also keeps test there.

@kyrylo kyrylo added the Feature label Mar 28, 2022
kyrylo added a commit that referenced this issue Apr 13, 2022
Fixes #679
(Remote configuration is polled for despite ignore_environments)
kyrylo added a commit that referenced this issue Apr 13, 2022
Fixes #679
(Remote configuration is polled for despite ignore_environments)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants