-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix runtime persistence config for releases, resolves #109 #111
Conversation
Thanks for this PR, @connorlay. I was affected by this and was very lost on how to fix it. It would be great to have this fixed. I took a look and it looks good to me! |
hi @connorlay have you seen my comment in #109 (comment)? Have you considered keeping it at compile-time but using |
I can probably also hack on it this weekend, this issue has bitten me already twice, I want it solved! hah 😄 |
This change is required for compatibility with upcoming Elixir 1.13. |
@tompave elixir 1.13 is coming soon and it'd be awesome to get this in. Really love the library, thanks for all your work on it and thank you @connorlay for resolving this issue! |
Hello, thank you for working on this, and apologies for the long wait. In the meantime, the code changes in the PR look good. @connorlay I've just released |
`defdelegate/2` calls `persistence_adapter/0` at compile-time, causing system env configuration to be read prematurely and stored into the function definition itself. This commit replaces calls to `defdelegate/2` with functions that call `persistence_adapter/0` at runtime, fixing the issue.
@tompave Done! It looks like I need maintainer approval to run the new CI jobs. |
Ok, I've caught up with the issue and the discussion in this PR. I think that this PR solves part of the problem, and I'm going to merge it. Thank you for working on this ❤️ and apologies again for the long wait. :-( When I say "part of the problem" I mean that the store module is still compiled into a module attribute in There are also another couple of One final comment. @dvic and @connorlay, on using
|
@marcandre and @k-cross: why do you think that this is a blocker for Elixir 1.13? It doesn't seem to be required in my tests with v1.13-rc0. |
The
I presume this is because of "Add defdelegate to the list of unallowed macros inside protocols as protocols do not allow function definitions" Latest release works. |
@marcandre Ah, I see. That was actually already fixed on master (but yet unreleased). It was fixed with #105. On the other hand, the current PR (111) removes other |
Ah, then my mistake, sorry 😅 |
defdelegate/2
callspersistence_adapter/0
at compile-time, causing system env configuration to be read prematurely and stored into the function definition itself. This commit replaces calls todefdelegate/2
with functions that callpersistence_adapter/0
at runtime, fixing the issue.I believe this resolves #109.