Skip to content

Leaks in configatron.temp #114

@andriytyurnikov

Description

@andriytyurnikov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions