livekit / server-sdk-ruby

LiveKit Server SDK for Ruby
Apache License 2.0
21 stars 15 forks source link

Gem is loaded before rails environment and it overrides the ActiveSupport #stringify_keys #56

Open m-hukic opened 1 month ago

m-hukic commented 1 month ago

Hello! Since it looks like this gem is not dependent on rails gem it gets loaded before the rails and overrides the default #stringify_keys method from rails which is causing very weird and almost untraceable issues especially in test environment!

Can we please add that dependency and ensure that it's not just overriding rails default behaviour or remove this monkey patch and switch to using #transform_keys(&:to_s) and #trasnform_values in one place where it's being used in the SDK. Here: https://github.com/livekit/server-sdk-ruby/blob/main/lib/livekit/grants.rb#L91

Using refinement should also limit the scope of the change of #stringify_keys

m-hukic commented 1 month ago

I've opened a PR https://github.com/livekit/server-sdk-ruby/pull/57 not sure if this would be acceptable solution to everyone there should be no functionality change to the gem 😄