-
-
Notifications
You must be signed in to change notification settings - Fork 306
Description
Describe the bug
Related to #2780, https://github.com/avo-hq/avo-dynamic_filters/pull/29
I wrote a bit about it on our Discord server, but I'll re-iterate here as well.
Avo Pro and Advanced users, please keep in mind that there might be a bug with some combinations of Avo 3.8 and Rails 7.1+
To spot the bug, try to add a dynamic filter to a resource or go to a dashboard page. If they are broken, there are a few things you can do:
- try to get on the latest tag or main with rails
- downgrade back to Avo 3.7.x until we find and ship a proper fix
- downgrade Rails to 7.0
The bug is in Rails with how it generates the path helpers on nested Rails engines.
In our case you mount avo in your routes.rb file and we mount dynamic_filters, dashboards, and more in avo's routes.rb file; hence the nesting.
Rails fails to detect that and generated wrong URL paths:
# instead of generating
/avo/dynamic_filters/SOME_ROUTE_IN_THAT_ENGINE
# it generates
/dynamic_filters/SOME_ROUTE_IN_THAT_ENGINE
It's a tricky case to fix properly for "all" use cases, all version combinations, and we've sunk in many hours into it in the past few weeks including troubleshooting, building a reproducible script, and working with the Rails team to bring that fix into Rails.
This is a priority on our side. We are shooting to have a fix early next week if this doesn't imply work on the Rails repo (which will add some more time).
🚨 What can you do to help?
Being that this bug manifests itself differently when mounting Avo, it would help to keep the ping-pong to a minimum if you could paste here the bit of code in your routes.rb file that is mounting the Avo engine or engines, but only if it's different from the standard way and not nested under a scope, namespace, or something else.
Also mention if, and how (route, subdomain, multi-domain) you're using multitenancy, as that's where it usually happens.
# "standard way"
mount Avo::Engine, at: Avo.configuration.root_path
# "standard way" in authentication
authenticate :user, ->(user) { user.is_admin? } do
mount Avo::Engine, at: Avo.configuration.root_path
end
# NOT standard
scope "(:locale)" do
mount Avo::Engine, at: Avo.configuration.root_path
end
# NOT standard
scope "/:something" do
mount Avo::Engine, at: Avo.configuration.root_path
# Mount Avo engines under the right path.
scope Avo.configuration.root_path do
instance_exec(&Avo.mount_engines)
end
endSystem configuration
Avo version: 3.8.0
Rails version: 7.1.x
License type:
- Community
- Pro
- Advanced
Impact
- High impact (It makes my app un-usable.)
- Medium impact (I'm annoyed, but I'll live.)
- Low impact (It's really a tiny thing that I could live with.)
Urgency
- High urgency (I can't continue development without it.)
- Medium urgency (I found a workaround, but I'd love to have it fixed.)
- Low urgency (It can wait. I just wanted you to know about it.)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status