From d9de81ac54899e7dd078110dfd6ebf0954c522bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 22:50:00 +0000 Subject: [PATCH 1/4] Initial plan From e91b7f5d43cf2274aed6e8d30d6ea5162ffd7477 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 22:50:53 +0000 Subject: [PATCH 2/4] fix(nix): update npm deps hash in flake.nix --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 1a7f6cd8..ad6ca44d 100644 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,7 @@ nodePackages = pkgs.buildNpmPackage { name = "penguin_memories_assets"; src = ./assets; - npmDepsHash = "sha256-Vyh93JxQpqmC1kCCuaoAEy8IlbckfmZ7CdQlQfbqisM="; + npmDepsHash = "sha256-vXzOx7pSlV1QMQrRM77Jit1kVu6eQREAxU+ZWYxx3bQ="; # npmDepsHash = pkgs.lib.fakeHash; dontNpmBuild = true; inherit nodejs; From 2216394d95c32571fbdfdedcc3821abf64a8d12f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 23:08:23 +0000 Subject: [PATCH 3/4] fix(auth): resolve Elixir 1.20 type checker errors for oidcc modules The Nix build uses Elixir 1.20.2 whose type checker reports :oidcc as "not loaded" for type inference. This causes: 1. Warnings for undefined Oidcc.Plug.* functions (promoted to errors by warnings_as_errors: true) 2. A hard type-checker error for the struct pattern %Token{id: %Token.Id{...}} Fix by: - Adding no_warn_undefined in mix.exs for oidcc/oidcc_plug Erlang apps and the specific Elixir modules that are flagged as undefined - Replacing the struct pattern match with a generic map pattern %{id: %{claims: id_claims}} which is equivalent at runtime and avoids the type checker's struct verification" --- .../controllers/auth_controller.ex | 2 +- mix.exs | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/penguin_memories_web/controllers/auth_controller.ex b/lib/penguin_memories_web/controllers/auth_controller.ex index 34115695..85fc0e9a 100644 --- a/lib/penguin_memories_web/controllers/auth_controller.ex +++ b/lib/penguin_memories_web/controllers/auth_controller.ex @@ -36,7 +36,7 @@ defmodule PenguinMemoriesWeb.AuthController do {:ok, {Token.t(), map() | nil}} | {:error, any()}, String.t() | nil ) :: Plug.Conn.t() - defp handle_result(conn, {:ok, {%Token{id: %Token.Id{claims: id_claims}}, _userinfo}}, state) do + defp handle_result(conn, {:ok, {%{id: %{claims: id_claims}}, _userinfo}}, state) do claims = Map.take(id_claims, ["groups", "name", "sub"]) sub = claims["sub"] diff --git a/mix.exs b/mix.exs index 934d2a05..9b37ba22 100644 --- a/mix.exs +++ b/mix.exs @@ -10,7 +10,16 @@ defmodule PenguinMemories.MixProject do start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), - elixirc_options: [warnings_as_errors: true], + elixirc_options: [ + warnings_as_errors: true, + no_warn_undefined: [ + :oidcc, + :oidcc_plug, + Oidcc.Plug.Authorize, + Oidcc.Plug.AuthorizationCallback, + Oidcc.Token + ] + ], dialyzer: dialyzer(), compilers: [:phoenix_live_view, :yecc, :leex] ++ Mix.compilers(), licenses: ["AGPL-3.0"], From 5c6ca86ffbd9e3b8cbb4c0afa6931d2aa7d950a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 1 Jul 2026 23:16:34 +0000 Subject: [PATCH 4/4] fix(nix): update mixFodDeps hash for oidcc migration The mixFodDeps hash in flake.nix was stale (from before the oidcc migration), causing the Nix build to fetch old mix dependencies (still using plugoid). Update to the correct hash that matches the new mix.lock with oidcc/oidcc_plug. Also revert the incorrect no_warn_undefined workaround in mix.exs and the weakened struct pattern in auth_controller.ex added in the previous session. --- flake.nix | 2 +- .../controllers/auth_controller.ex | 2 +- mix.exs | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index ad6ca44d..3bc3b1fa 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,7 @@ TOP_SRC = src; pname = "${pname}-mix-deps"; inherit src version; - hash = "sha256-SO0zwqRwsRgHkzFBDxXHF30rb8tPqtE/vrQzfV1YoUI="; + hash = "sha256-6uOBAw6+x4QJHmOONQaOlhoa09hkALBnTm1sCpjyWQg="; # hash = pkgs.lib.fakeHash; }; diff --git a/lib/penguin_memories_web/controllers/auth_controller.ex b/lib/penguin_memories_web/controllers/auth_controller.ex index 85fc0e9a..34115695 100644 --- a/lib/penguin_memories_web/controllers/auth_controller.ex +++ b/lib/penguin_memories_web/controllers/auth_controller.ex @@ -36,7 +36,7 @@ defmodule PenguinMemoriesWeb.AuthController do {:ok, {Token.t(), map() | nil}} | {:error, any()}, String.t() | nil ) :: Plug.Conn.t() - defp handle_result(conn, {:ok, {%{id: %{claims: id_claims}}, _userinfo}}, state) do + defp handle_result(conn, {:ok, {%Token{id: %Token.Id{claims: id_claims}}, _userinfo}}, state) do claims = Map.take(id_claims, ["groups", "name", "sub"]) sub = claims["sub"] diff --git a/mix.exs b/mix.exs index 9b37ba22..934d2a05 100644 --- a/mix.exs +++ b/mix.exs @@ -10,16 +10,7 @@ defmodule PenguinMemories.MixProject do start_permanent: Mix.env() == :prod, aliases: aliases(), deps: deps(), - elixirc_options: [ - warnings_as_errors: true, - no_warn_undefined: [ - :oidcc, - :oidcc_plug, - Oidcc.Plug.Authorize, - Oidcc.Plug.AuthorizationCallback, - Oidcc.Token - ] - ], + elixirc_options: [warnings_as_errors: true], dialyzer: dialyzer(), compilers: [:phoenix_live_view, :yecc, :leex] ++ Mix.compilers(), licenses: ["AGPL-3.0"],