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

Leaks in configatron.temp #114

Open
andriytyurnikov opened this issue May 10, 2024 · 1 comment
Open

Leaks in configatron.temp #114

andriytyurnikov opened this issue May 10, 2024 · 1 comment

Comments

@andriytyurnikov
Copy link

andriytyurnikov commented May 10, 2024

We've faced an issue with configatron.temp due to unexpected side effect

  # config changes in  rspec case
  # leaked into other
 configatron.temp do
      #leaks
      configs.each { |config| configatron.origins[config.origin_id] = { app_id: '123' } }
      # doesn't leak
      # configatron.origins = configs.map { |cfg| [cfg.origin_id, { app_id: '123' }] }.to_h
      example.run
end

After skimming through source code of configatron.temp, I humbly suggest authors to consider implementation of configatron.temp with Marshal.dump and Marshal.load, which looks like straightforward solution with rather strong guarantees.

@andriytyurnikov
Copy link
Author

Proof of concept solution is at minichat-com#1

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

No branches or pull requests

1 participant