Comments (11)
I'll make sure this is fixed with the next release v0.9.5
Figured what the problem is so the fix just needs to be nicely implemented.
from kaffy.
We also encounter this in production. It appears that if a server has had the Kaffy homepage/initial dashboard requested, all subsequent requests to that server will serve correctly. For servers that have not yet had the initial dashboard requested, but where a direct link to e.g. a resource index is used by a user (from elsewhere), they'll encounter this error.
In practice running across multiple hosts, this means that a user could load the dashboard successfully, click to visit a resource (which then is routed to a different host) and encounter this issue.
from kaffy.
Does this still happen with Kaffy 0.9.4?
from kaffy.
Yes. Below a stacktrace from 0.9.4
ArgumentError: errors were found at the given arguments:
* 1st argument: not an already existing atom
Module "erlang", in :erlang.binary_to_existing_atom/2
File "lib/kaffy/utils.ex", line 365, in Kaffy.Utils.convert_to_atom/1
File "lib/kaffy/utils.ex", line 361, in Kaffy.Utils.convert_to_atoms/2
File "lib/kaffy/utils.ex", line 218, in Kaffy.Utils.get_resource/3
File "lib/kaffy_web/controllers/resource_controller.ex", line 55, in KaffyWeb.ResourceController.index/2
File "lib/kaffy_web/controllers/resource_controller.ex", line 1, in KaffyWeb.ResourceController.action/2
File "lib/kaffy_web/controllers/resource_controller.ex", line 1, in KaffyWeb.ResourceController.phoenix_controller_pipeline/2
File "lib/phoenix/router.ex", line 354, in Phoenix.Router.__call__/2
from kaffy.
Yes, can confirm. This also happens in 0.9.4
from kaffy.
I'm also running into this issue. @aesmail can you point out what the problem is? Someone else might be able to implement a fix.
In the meantime, I've worked around this by setting a module attribute with the atom in my admin module so it already exists when Kaffy calls binary_to_existing_atom
.
@fix_kaffy_issue :users
from kaffy.
Thanks @aesmail.
I saw some "to existing atom" changes on the 0.9.5 branch, but I was still seeing errors when restarting the server and then visiting a deep link without first going to the dashboard. So I assume you're not quite done yet.
from kaffy.
Where are we with this? Is PR #261 still required?
from kaffy.
@ghenry #261 might fix the issue, but I'm worried about the use of String.to_atom/1
. This might crash the app during runtime due to dynamically creating atoms. It might not be a big deal, but you never know. I could be a bad guy and try to hit random non-existent URLs just to crash the app.
from kaffy.
What other Elixir idioms or design pattern options are there here?
from kaffy.
For example, what do projects like https://github.com/plausible/analytics do or other projects we could look at? I'm sure it's a solved problem already?
from kaffy.
Related Issues (20)
- [FEATURE-REQUEST] Bulk Delete HOT 1
- [FEATURE-REQUEST] custom_index_query should receive all rather than paged HOT 1
- [FEATURE-REQUEST] Have a way to call a custom attribute in show/edit/create
- [FEATURE-REQUEST] - resolve deprecation warnings in Phoenix 1.7 HOT 1
- [FEATURE-REQUEST] allow to modify auto-detected resources HOT 1
- [BUG] :readonly option not working HOT 1
- [FEATURE-REQUEST] Hide action buttons in show template HOT 1
- Unexpected error `Enumerable not implemented for nil of type Atom` HOT 3
- [BUG] Crash occurs when a schema has a `:page` field or association
- [FEATURE-REQUEST] Config option to turn off bulk delete HOT 6
- [BUG] readonly also not working with dropdown fields HOT 1
- [BUG] Resource creation errors when schema contains {:array, Ecto.Enum} field ((FunctionClauseError) no function clause matching in String.length/1) HOT 2
- [BUG] create action broken HOT 3
- [BUG] (UndefinedFunctionError) function :ping_erlang.__info__/1 is undefined or private HOT 2
- How can I make Main Dashboard widgets? HOT 2
- How do I change the `default_actions/1` for all schemas at once?
- [Feature] Phoenix HTML 4.0 not supported HOT 17
- [FEATURE-REQUEST] Role-based admins HOT 2
- [BUG] Compilation error on Elixir 1.17 HOT 1
- Release new Version for Phoenix.HTML 4.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kaffy.