You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include your initializer, sidekiq.yml, and any error message with the full backtrace.
I have a middleware setup on my application which will set the I18n.locale based on either the URL parameter
'locale', or if not available, use the first of the HTTP_ACCEPT_LANGUAGE
values to infer the locale to be used. It sets said locale as a symbol.
Sidekiq web throws the following error now on opening: TypeError: no implicit conversion of nil into Hash
@strings[lang] ||= settings.locales.each_with_object({}) do |path, global|
find_locale_files(lang).each do |file|
strs = YAML.safe_load(File.read(file))
global.merge!(strs[lang])
end
# session[:locale] is set via the locale selector from the footer
# defined?(session) && session are used to avoid exceptions when running tests
return session[:locale] if defined?(session) && session&.[](:locale)
Prior to this change, when the :locale is not set within the session it defaults to "en"
Post this change, it uses the session['locale'] if available which in my application is always a symbol.
But since the strings method has strs which loads the locales as a hash with strings as keys it will cause the above mentioned error.
Ruby version: 3.2.4
Rails version: 7.1.3
Sidekiq / Pro / Enterprise version(s): 7.2.4
Please include your initializer, sidekiq.yml, and any error message with the full backtrace.
I have a middleware setup on my application which will set the I18n.locale based on either the URL parameter
'locale', or if not available, use the first of the HTTP_ACCEPT_LANGUAGE
values to infer the locale to be used. It sets said locale as a symbol.
Sidekiq web throws the following error now on opening:
TypeError: no implicit conversion of nil into Hash
On digging further this was thrown from here:
sidekiq/lib/sidekiq/web/helpers.rb
Line 19 in 30786e0
Since this was working until Sidekiq 7.2.2 i figured this must be due to a recent change which led me to:
https://github.com/sidekiq/sidekiq/pull/6217/files#diff-a19b19d20df90597eaac2e2edc433b5d56d1d30a8501029bfd9688a8980dd150R124-R127
Prior to this change, when the :locale is not set within the session it defaults to
"en"
Post this change, it uses the
session['locale']
if available which in my application is always a symbol.But since the
strings
method hasstrs
which loads the locales as a hash with strings as keys it will cause the above mentioned error.I have a possible fix for this in this PR: #6272
The text was updated successfully, but these errors were encountered: