-
Notifications
You must be signed in to change notification settings - Fork 223
Description
Hi,
I'm just wondering if this is something that needs to be fixed or I'm using it wrong.
I'm not exactly sure how this is happening as I don't see the sender of this request, but I'm getting this exception.
Elixir.FunctionClauseError: no function clause matching in anonymous fn/1 in Coherence.CredentialStore.Server.handle_cast/2
File "lib/coherence/plugs/authorization/credential_store/server.ex", line 88, in anonymous fn/1 in Coherence.CredentialStore.Server.handle_cast/2
File "lib/kernel.ex", line 2136, in anonymous fn/2 in Kernel.update_in/3
File "lib/map.ex", line 791, in Map.get_and_update/3
File "lib/kernel.ex", line 2136, in Kernel.update_in/3
File "lib/coherence/plugs/authorization/credential_store/server.ex", line 88, in Coherence.CredentialStore.Server.handle_cast/2
File "gen_server.erl", line 637, in :gen_server.try_dispatch/4
File "gen_server.erl", line 711, in :gen_server.handle_msg/6
File "proc_lib.erl", line 249, in :proc_lib.init_p_do_apply/3
Module "Elixir.Coherence.CredentialStore.Server", in Coherence.CredentialStore.Server.init/1
We're calling Coherence.update_user_logins(user) when admin updates user's record in order to make sure the logged in users credentials gets updated as well.
I think exception is happening due to the fact that the user is not logged in at the time of this update as this code below doesn't seem to handle signed out users.
I'm wondering if we need to add extra match something like fn nil -> nil to make sure we gracefully handle cases where the user data doesn't present on the GenServer.
Please let me know if this seems like a way to go, I'll submit a PR for that.
Thanks,
David