Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backwards Compatible Calls cause exception #451

Closed
nduitz opened this issue Mar 11, 2020 · 4 comments
Closed

Backwards Compatible Calls cause exception #451

nduitz opened this issue Mar 11, 2020 · 4 comments

Comments

@nduitz
Copy link
Contributor

nduitz commented Mar 11, 2020

Using pow_postgres_store the first time logging in after application startup causes an exception:

function Pow.Postgres.Store.keys/1 is undefined or private

The issue here seems to be:
defp has_binary_keys?(store) do: not function_exported?(store, :all, 2)

Documentation states:

Note that this function does not load the module in case it is not loaded.
Check Code.ensure_loaded/1 for more information.

So simply calling Code.ensure_loaded(store) upfront fixes the issue.

To reproduce this behaviour setup pow_postgres_store as store and try a login directly after application startup.

@nduitz
Copy link
Contributor Author

nduitz commented Mar 11, 2020

See MR: #452

@danschultzer
Copy link
Collaborator

Thanks! 🙏

The PR looks good though I try to get around all Code.ensure_compiled?/1 and Code.ensure_loaded?/1 calls due to #329. Guess Pow 1.1.0 can't come soon enough now! I want to review a few alternative ideas but otherwise get this merged.

Out of curiosity, does this only occur if you start up with mix phx.server instead of running a release?

@danschultzer
Copy link
Collaborator

Solved with #452 8e5a20f

@nduitz
Copy link
Contributor Author

nduitz commented Mar 12, 2020

Out of curiosity, does this only occur if you start up with mix phx.server instead of running a release?

I can confirm that this does only occur running mix phx.server.

But thanks for merging this <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants