fjordllc / bootcamp

プログラマー向けEラーニングシステム
https://bootcamp.fjord.jp
MIT License
281 stars 71 forks source link

開発環境とステージング環境で5期生のユーザ一覧が表示されない #7057

Closed Kassy0220 closed 9 months ago

Kassy0220 commented 10 months ago

概要

開発環境とステージング環境で5期生のユーザー一覧ページ(/generations/5)にアクセスすると、次のような表示になり正しく表示されません。

再現手順

期待される振る舞い

5期生のデータは以下の通り22人分存在するはずなので、22人のユーザーが表示される。

_development__期生別ユーザー一覧___FBC

スクリーンショット

環境

エラーログ

ログを確認すると、次のようなログがありました。

fsevent_watch

おそらく、Discord情報が未登録のユーザーデータがエラーを引き起こしているものと思われます。

irb(main):005:0> user = User.find(320383523)
  User Load (0.8ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 320383523], ["LIMIT", 1]]
=>                                                   
#<User:0x000000010c02ea60                            
...                                                  
irb(main):006:0> user.name
=> "Discord 未登録"
irb(main):007:0> user.discord_profile
  DiscordProfile Load (0.7ms)  SELECT "discord_profiles".* FROM "discord_profiles" WHERE "discord_profiles"."user_id" = $1 LIMIT $2  [["user_id", 320383523], ["LIMIT", 1]]
=> nil 
irb(main):008:0> user.discord_profile.account_name
(irb):8:in `<main>': undefined method `account_name' for nil:NilClass (NoMethodError)
junohm410 commented 9 months ago

修正により、ステージング環境でも5期生のユーザー一覧ページが正しく表示されることを確認しました。 本番環境には影響のないIssueのため、これをもちまして本IssueはCloseといたします。

image