eyra / mono

Monorepo (used by Next Platform)
https://eyra.co
GNU Affero General Public License v3.0
5 stars 2 forks source link

Server error 500 when clicking on support ticket #773

Open TjerkNan opened 2 months ago

TjerkNan commented 2 months ago

Describe the bug I'm trying to address support tickets by accessing the support item in the menu on the left.

image

As soon as I click on the support ticket, the page hangs and eventually we get an Internal Server error 500

image

May be related to #672

To Reproduce Steps to reproduce the behavior:

  1. login as admin user with google authentication
  2. Click on support to the left
  3. Click on the support ticket

Expected behavior The actual ticket, not a crash

Screenshots https://github.com/eyra/mono/assets/88683839/1b6caf3d-13a9-4928-982a-68413e15a38e

{"time":"2024-04-22T19:05:52.467Z","severity":"error","message":"an exception was raised:\n    ** (FunctionClauseError) no function clause matching in Systems.Support.TicketPage.to_member/1\n        (core 0.1.0) systems/support/ticket_page.ex:40: Systems.Support.TicketPage.to_member(%Systems.Support.TicketModel{__meta__: #Ecto.Schema.Metadata<:loaded, \"helpdesk_tickets\">, id: 1, user_id: 24, user: #Core.Accounts.User<__meta__: #Ecto.Schema.Metadata<:loaded, \"users\">, id: 24, email: \"a.m.mendrik@gmail.com\", hashed_password: \"$2b$12$3bv.Ykm6uwVKZ66/Cy0JD.Q5oiwPqfeSHC4Q7UgJZxR3rRF35VGn2\", confirmed_at: ~N[2024-01-18 09:00:59], displayname: nil, visited_pages: nil, researcher: true, student: nil, coordinator: nil, profile: %Core.Accounts.Profile{__meta__: #Ecto.Schema.Metadata<:loaded, \"user_profiles\">, id: 64, fullname: nil, title: nil, photo_url: nil, user_id: 24, user: #Ecto.Association.NotLoaded<association :user is not loaded>, inserted_at: ~N[2024-03-31 19:07:58], updated_at: ~N[2024-03-31 19:07:58]}, features: nil, inserted_at: ~N[2024-01-18 08:59:23], updated_at: ~N[2024-01-18 09:00:59], ...>, type: :question, description: \"test\", title: \"Test\", completed_at: nil, inserted_at: ~N[2024-01-18 10:44:11], updated_at: ~N[2024-01-18 10:44:11]})\n        (core 0.1.0) systems/support/ticket_page.ex:37: Systems.Support.TicketPage.update_member/1\n        (core 0.1.0) systems/support/ticket_page.ex:30: Systems.Support.TicketPage.\"mount (overridable 1)\"/3\n        (phoenix_live_view 0.20.1) lib/phoenix_live_view/utils.ex:394: anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5\n        (telemetry 1.2.1) /home/runner/work/mono/mono/core/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3\n        (phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:1127: Phoenix.LiveView.Channel.verified_mount/8\n        (phoenix_live_view 0.20.1) lib/phoenix_live_view/channel.ex:84: Phoenix.LiveView.Channel.handle_info/2\n        (stdlib 4.0.1) gen_server.erl:1120: :gen_server.try_dispatch/4","metadata":{"domain":["elixir"],"erl_level":"error"}}

Desktop (please complete the following information): mac safari

AdrienneMendrik commented 2 days ago

Just tested this on dev. I encountered the same issue. @emielvdveen is this a lot of work to fix? Would be good if we can address support tickets on production.

https://github.com/eyra/mono/assets/79082794/00d81c9c-1eb8-4b63-8238-3e791a03c8fb