77 Replies
And when I downgraded version back I got another error:
Any ideas what went wrong? Will appreciate any suggestions.
I don't have any overrides if it matters
π€ I think @jart will need to chime in
Actually have you tried force recompiling after updating?
yes, I have tried that
Kk. Iβll update ash_hq to the latest for those libraries and see if I get the same thing
Yeah, I'm getting these errors too
π€
I think I see where it is
lemme confirm
So for some reason:
is returning the addons as well
and that is causing this issue
hmm
Its definitely an underlying thing, will fix
found it
I just pushed to main, can you try that out? Of
ash_authentication
sure
I still get
btw I also had to override
ash_authentication
, because of
Yeah, okay I think I see how that could be happening too
π€ do you have multiple resources that can be used to sign in?
like different kind of users?
yeah
then just one
But I have both password and github
everything was fine a week ago
Yeah, we made changes to the underlying library to support custom strategies
Which is a great thing π
But there are a few kinks it seems
okay
I suspect that the duplicate ids error was there in previous versions
thats just a warning in the browser console right?
nope, that a proper error
oh, really?


gotcha
Okay...does your user resource appear in multiple apis?
The reason I ask is that the hr is defined once per resource it thinks you could authenticate as
What does this return for you in
iex
Thanks for jumping in Zach. Sorry about leaving a mess. Iβll take a look at your fixes today and try and write tests to avoid regressions.
There is still one more that I don't understand, which is the duplicate horizontal rule
I accidentally pushed the first fix straight to main though π
Nothing like a YOLO release to wake you up in the morning.
This is why I do explicit releases in Ash
Hey it wonβt release if it doesnβt build.
true true
it does I guess, I had to add it to another API's registry, where it was related to. Like MyApp.Accounts.User I've added to MyApp.Blog.Registry because of
author
relation in MyApp.Blog.Post
otherwise it was compile time erroring Resources MyApp.Accounts.User must be included in the registry.
Ah, okay
So we can fix that
π
but also you don't actually have to add it to your other registry if you don't want to
I need to update the error message
oo
i felt it wasn't right
But you can do
You just need to configure which api to use if its not in the same one as the resource
but i have this already
Yeah, that tripped me up the other day! I just started using split APIs now that it's a lot easier to cross the boundaries w/ resources.
π€ that should be all you need to do
Perhaps double check the error message after you do that?
i.e remove user from the blog context
you mean registry? i just removed it from the registy
yeah, sorry, registry π
I haven't split up my large app yet, but I'm interested in seeing how much that improves compile times once I do.
then I get
Resources OpenStatus.Accounts.User must be included in the registry
π€ π€ π€
Do you have any other resources that point to that?
anyways everything was fine until I've updated dependencies to the latest, today
π€ I'm on all the latest and I don't have that issue w/ crossing apis... I'll push something up that provides a better error message and maybe that will help
i have two resources under
OpenStatus.Monitors
with relations to OpenStatus.Accounts.User
and so far there are only two API in my project, Accounts and Monitors
i thought it's strange, but thought it's for the sake of compiler optimization or something, was going to ask you later
i can share the repo with you if it would helpI'll push up an improvement to the error message in just a sec and it should tell us exactly what it thinks the issue is π
cool, standing by
Meanwhile, are both the apis added to
config.exs
? That's easy to forget to do!yup
like I said it was working last week
That is very strange.
agree
You didn't make any changes to your resources?
no, I've set up the auth, logged-in and was working on liveviews, until today I've decided to update the deps
oh, well
That could be something to do with only doing a partial recompile while you're working
i've changed the resources, last time last week, but it was ok until the deps update
and so the registry didn't recompile or something along those lines
but when you pull latest ash, all the ash stuff has to recompile
which is bad, it should have told you about this right away
but I think that is the reason you didn't see it before.
today I've also tried to remove
_build
dir and recompile the whole thingYeah, so the idea here is that it was broken before, but the error wasn't showing because of partial recompilation
so clearing _build wouldn't help
nope
okay can you try main? I made the validation much simpler and had it produce a much better error message
main ash_auth? it's in my mix.exs already, or you mean another package?
Main ash
okay
And you'd need to do
mix deps.update ash_authentication
to pull latest main of ash_authentication anyway (a common thing that trips people up, so just letting you know)I'll remove
_build
and deps
Shouldn't be necessary, but its fine if you do
got this
going to override
Ah, yeah you'll always have to do that if you set ash or any library that has something depending on it to a github dependency
ooo i guess the new error message works! π
π₯³
so yeah I had another resouse in the api with a relation to User which didn't specify Accounts api
Got it, was hoping that was the issue π
the sign-in also works now!
huge thanks to all of you guys!
I've made PRs to ash_authentication & ash_authentication_phoenix to solve it in the future so that if someone actually does have their user in multiple apis on purpose, they won't encounter the issue that you did
Glad to help! Thank you for helping us work out the kinks and being patient π Even more cool stuff is coming for ash_authentication over time which is really exciting.
can't wait π
marking the tread as resolved
I beat you to it π
^ EXCELLENT error message, so much better! :ashley:
Some of these things are like no brainers once you realize it, but its hard to see when I'm so familiar with the issue
but thats something that people encounter all the time, especially newer people
In my case, I moved stuff around in an existing app, was kind of hard to figure out which file was missing the API declaration. π
Even though I knew that's what it was. W/ this new error, no-brainer.
β π§