todoist.nvim icon indicating copy to clipboard operation
todoist.nvim copied to clipboard

Can't sync updates to todoist

Open mibzman opened this issue 3 years ago • 5 comments

When trying to create or edit a task, or refreshing, I get this error:

Error detected while processing function Todoist__onRefresh[1]..remote#define#notify:
line    6:
E475: Invalid argument: Channel doesn't exist

I

mibzman avatar Mar 03 '22 15:03 mibzman

Can't reproduce :| Any other details?

romgrk avatar May 14 '22 10:05 romgrk

@romgrk I'm seeing the same error. I can use :Todoist Testing to create a new project (and I can see it in todoist.com), but if I try creating a new task with o, it just silently fails.

Then if I r or o again, I see the same error as @mibzman posted.

Neovim version:

NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Node: v18.1.0. Neovim node package: [email protected].

Minimal vimrc I used to reproduce this issue:

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath

call plug#begin('~/.vim/plugged')
Plug 'romgrk/todoist.nvim', { 'do': ':TodoistInstall' }
call plug#end()

set nocompatible
set updatetime=300
set cmdheight=2

:checkhealth reported no errors. Node section:

## Node.js provider (optional)
  - INFO: Node.js: v18.1.0
  - INFO: Nvim node.js host: /home/frederick/.npm-global/lib/node_modules/neovim/bin/cli.js
  - OK: Latest "neovim" npm/yarn package is installed: 4.10.1

Frederick888 avatar May 16 '22 11:05 Frederick888

I am having the exact same problem as @Frederick888.

irishmac473 avatar May 20 '22 06:05 irishmac473

Sorry this will probably be inconvenient, but the only I'll be able to provide assistance is if you enable debug logging by setting the correct level and providing a log file path, see https://github.com/neovim/node-client#logging

I've tested creating a new project & tasks, both succeed on my end.

romgrk avatar Jul 31 '22 04:07 romgrk

Logs:

{"level":"debug","message":"host.start"}
{"level":"info","message":"handleRequest: "}
{"level":"debug","message":"request received: "}
{"level":"info","message":"handleNotification: "}
{"level":"debug","message":"host.handlePlugin: "}
{"level":"debug","message":"createPlugin./home/frederick/.vim/plugged/todoist.nvim/rplugin/node/todoist.clearCache: true"}
{"level":"debug","message":"getPlugin.alwaysInit"}
{"level":"debug","message":"request -> neovim.api.nvim_eval"}
{"level":"debug","message":"response -> neovim.api.nvim_eval: [object Object]"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: -1"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_get_current_buf"}
{"level":"debug","message":"response -> neovim.api.nvim_get_current_buf: [object Object]"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"info","message":"handleNotification: "}
{"level":"debug","message":"host.handlePlugin: "}
{"level":"debug","message":"getPlugin.useCachedPlugin"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 3"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: Hello, world!"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: "}
{"level":"debug","message":"request -> neovim.api.nvim_call_function"}
{"level":"debug","message":"response -> neovim.api.nvim_call_function: 0"}

And here's a Dockerfile to reproduce this issue:

FROM archlinux:latest

RUN pacman -Sy --noconfirm
RUN pacman -Sy --noconfirm neovim git nodejs npm curl
RUN npm install -g neovim@latest

RUN mkdir -p /root/.config/nvim /root/.vim/autoload /root/.vim/plugged
ADD ./init.vim /root/.config/nvim/init.vim
ADD ./rc.vim /root/.vimrc
RUN curl -fLo /root/.vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
RUN nvim +PlugInstall +qa

init.vim

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

rc.vim

call plug#begin('~/.vim/plugged')
Plug 'romgrk/todoist.nvim', { 'do': ':TodoistInstall' }
call plug#end()

set nocompatible
set updatetime=300
set cmdheight=2

Put these three files in the same directory, then

$ docker build -t nvim .
$ docker run --rm -it -e "TODOIST_API_KEY=$TODOIST_API_KEY" nvim bash
# In container
$ cd
$ nvim .vimrc
# In Neovim
:TodoistInstall  <-- somehow I needed to run this again, probably due to how post-upgrade hooks are handled by vim-plug

Frederick888 avatar Jul 31 '22 11:07 Frederick888