Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recurring error "key :todos not found in: %Desktop.Menu" #12

Closed
adamwight opened this issue May 13, 2022 · 1 comment · Fixed by #13
Closed

Recurring error "key :todos not found in: %Desktop.Menu" #12

adamwight opened this issue May 13, 2022 · 1 comment · Fixed by #13

Comments

@adamwight
Copy link
Contributor

I'm currently running the Todo application in an OS browser mode and I don't see any menu bar, so maybe this is only a partially-supported mode. But an error like this is logged after every user action:

[error] ** (KeyError) key :todos not found in: %Desktop.Menu{__adapter__: %Desktop.Menu.Adapter.Wx{env: {:wx_env, #Reference<0.1510893025.2632056833.118813>, #PID<0.514.0>, 0}, menu_pid: #PID<0.727.0>, menubar: {:wx_ref, 54, :wxMenuBar, []}, menubar_opts: {:taskbar, {:wx_ref, 41, :wxIcon, []}}, taskbar_icon: %Desktop.Wx.TaskBarIcon{fn_create_popup: #Function<4.88399616/0 in Desktop.Menu.Adapter.Wx.create_menubar/3>, skip_popup_menu?: true, wx_taskbar_icon: {:wx_ref, 55, :wxTaskBarIcon, []}}}, app: :todo_app, assigns: %{todos: [%TodoApp.Todo{__meta__: #Ecto.Schema.Metadata<:loaded, "todos">, id: 1, status: "todo", text: "foo"}, %TodoApp.Todo{__meta__: #Ecto.Schema.Metadata<:loaded, "todos">, id: 3, status: "todo", text: "bar"}]}, dom: [], last_render: nil, module: TodoApp.Menu, pid: #PID<0.727.0>}
    (todo_app 1.0.0) lib/todo_app/menu.ex:34: TodoApp.Menu.set_state_icon/1
    (todo_app 1.0.0) lib/todo_app/menu.ex:28: TodoApp.Menu.handle_info/2
    (desktop 1.4.1) lib/desktop/menu.ex:462: Desktop.Menu.invoke_module_func/3
    (desktop 1.4.1) lib/desktop/menu.ex:430: Desktop.Menu.proxy_handle_info/2
    (desktop 1.4.1) lib/desktop/menu.ex:390: Desktop.Menu.handle_info/2
    (stdlib 3.17.1) gen_server.erl:695: :gen_server.try_dispatch/4
    (stdlib 3.17.1) gen_server.erl:771: :gen_server.handle_msg/6
    (stdlib 3.17.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
@adamwight
Copy link
Contributor Author

Running the application again but with the GTK3 backend, I still see the same error. Seems to be a legitimate bug, the code should probably be checking for :todos under the assigns key.

adamwight added a commit to adamwight/elixir-desktop-example-app that referenced this issue May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant