Skip to content

Fix: move sms config to jh initializers fold

Martin Tan请求将fix/area-codes-nil合并到main-jh

Related to !662 (merged)

What does this MR do and why?

This does not happen on production.

The jh/lib/jh/sms.rb is included in Rails autoload list and will be reloaded in development mode according to Rails autoloading doc, then the JH::Sms.config used in views will be reset to nil.

Rails.application.config.autoload_paths.grep /jh\/lib/
=> ["/Users/mtan/dev/jihu-gitlab/gitlab/jh/lib", "/Users/mtan/dev/jihu-gitlab/gitlab/jh/lib/generators"]

To fix this we need to:

  • Move the jh/lib/jh/sms.rb to initializers fold to avoid the file reloading.

Screenshots or screen recordings

nil_class

How to set up and validate locally

  1. Goto {{YOUR_HOST}}/users/sign_up
  2. You should see the phone area code drop list
  3. Add a comment to a random file under /jh/lib/
  4. Reload your browser
  5. Then you should see this error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Martin Tan 编辑于

合并请求报告

加载中