Closed Sgoettschkes closed 9 months ago
Hi @Sgoettschkes ! I will move your comment to #40 which seems to be exactly the same issue!
I will tackle this next. I have already merged the change to a GenServer from a Task which SHOULD have fixed the main issue (since we now initialize this on a callback).
Thanks for raising this!
We use joken and joken_jwks in our application and it works very well.
Our usage is very basic (I believe). We have the following Token implementation:
And the following strategy:
We face some issues with our app refusing to start (in staging, mostly) with the following error message:
It seemed like a race condition because it worked most of the time. We were not able to figure out what went wrong and diving into the joken_jwks code, it seems strange that the ETS table would not be created because we'd expect the process to fail earlier when setting the counter to 0.
After some more investigating, the problem seems to be related to the compilation step, not the runtime. The reason we suspect this is that a build that throws the error above does it every time it's started and a build that does not throw on the first start does not throw at all. Locally it's the same, as soon as the app throws the error at startup each
mix phx.server
will throw the error. Recompiling the app will solve this, but changing unrelated files (which only trigger a partial recompile) does not.