Recompilation speedup: avoid dependency on Pleroma.User in EnsurePublicOrAuthenticatedPlug
Alright guys, I saved the best for last. This one needs to break a cycle on EnsurePublicOrAuthenticatedPlug, a frequent compile dep, by getting rid of its dependency on Pleroma.User.
To do that I just made it check that assigns.user
is a struct, and not %User{}
specifically. This gets rid of the last cycle for the coveted "No cycles found" message.
There is an alternate way to solve this problem, by refactoring :skip_plug
calls into functions of Pleroma.Web
. You can see that here: https://git.pleroma.social/pleroma/pleroma/-/compare/develop...cycles-plug-deps
Let me know which way you prefer.
Edited by Alex Gleason