Code Monkey home page Code Monkey logo

Comments (11)

aesmail avatar aesmail commented on August 16, 2024 4

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.

elliotb avatar elliotb commented on August 16, 2024 2

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.

aesmail avatar aesmail commented on August 16, 2024

Does this still happen with Kaffy 0.9.4?

from kaffy.

lsxliron avatar lsxliron commented on August 16, 2024

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.

bitboxer avatar bitboxer commented on August 16, 2024

Yes, can confirm. This also happens in 0.9.4

from kaffy.

jcelliott avatar jcelliott commented on August 16, 2024

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.

nathany-copia avatar nathany-copia commented on August 16, 2024

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.

ghenry avatar ghenry commented on August 16, 2024

Where are we with this? Is PR #261 still required?

from kaffy.

aesmail avatar aesmail commented on August 16, 2024

@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.

ghenry avatar ghenry commented on August 16, 2024

What other Elixir idioms or design pattern options are there here?

from kaffy.

ghenry avatar ghenry commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.