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

Yanky with sqlite enabled in combination with Noice locks up Neovim #56

Closed
folke opened this issue Oct 4, 2022 · 11 comments
Closed

Yanky with sqlite enabled in combination with Noice locks up Neovim #56

folke opened this issue Oct 4, 2022 · 11 comments

Comments

@folke
Copy link
Contributor

folke commented Oct 4, 2022

Hi!

First of all I really love what you did with Yanky. Awesome plugin!

I enabled the new sqlite storage earlier today and started having lock ups of Neovim pretty consistent.

The lockup itself is caused by some sort of notifying -> triggers error -> tries to notify the error loop.

That part I can fix on my end, but the reason seems to be this error:

E565: Not allowed to change text or change window

I get the lock ups when yanking or deleting lines. About 80% of the time.

It seems the usage of sqlite is causing this somehow. Any ideas?

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

 #11 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>
 #12 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #13 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #14 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>
 #15 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>
 #16 msg_show Error running notification service: ...ite/pack/packer/opt/nvim-notify/lua/notify/util/init.lua:78: E565: Not allowed to change text or change window
 #17 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #18 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #19 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>
 #20 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #21 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #22 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>
 #23 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #24 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #25 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>
 #26 msg_show.lua_error Error detected while processing TextYankPost Autocommands for "*":
 #27 msg_show Error executing lua callback: ...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: sqlite.lua: sql statement parse, , stmt: `DELETE FROM history LIMIT 100 OFFSET 100`, err: `(`near "LIMIT": syntax error`)`
stack traceback:
	[C]: in function 'assert'
	...nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/stmt.lua:35: in function 'parse'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:287: in function 'eval'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:47: in function 'func'
	...e/nvim/site/pack/packer/opt/sqlite.lua/lua/sqlite/db.lua:218: in function 'with_open'
	.../pack/packer/opt/yanky.nvim/lua/yanky/storage/sqlite.lua:41: in function 'push'
	...im/site/pack/packer/opt/yanky.nvim/lua/yanky/history.lua:21: in function 'push'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:229: in function 'on_yank'
	...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:46: in function <...share/nvim/site/pack/packer/opt/yanky.nvim/lua/yanky.lua:45>

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

The E656 error is because the yank is still in progress. Those are the errors I got from yanky.

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

Found the issue. The bad query, cause an errro being displayed by Noice, while the yank is still in progress. Displaying that, raises the E656 error causing a loop.

I'm working on a PR to fix this.

Also better to save to history in vim.schedule, so that yanking doesnt block.

@gbprod
Copy link
Owner

gbprod commented Oct 4, 2022

Thanks for your feedback!
I really love your plugins and I want to try noice.nvim 🙂

Can you tell me what is your version of SQLite ?
It seems that I use a delete syntax that could be not supported by your SQLite.

I try to fix it as soon as possible 🙂

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

I'm on Fedora 37. Probably becuase of missing https://www.sqlite.org/compile.html#enable_update_delete_limit indeed

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

#57 will at least stop locking up Noice :)

@gbprod
Copy link
Owner

gbprod commented Oct 4, 2022

#57 will at least stop locking up Noice :)

Thanks ! I merge this PR and I will fix this bad query !

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

Properly fixed by #58
Without the vim.schedule

@gbprod
Copy link
Owner

gbprod commented Oct 4, 2022

Thanks for the fix, I'll try to improve error handling using vim.schedule or pcall.

@folke
Copy link
Contributor Author

folke commented Oct 4, 2022

@gbprod the problem with the error was caused by Noice, since we were inside a textlock, we did all message processing realtime. And that ttriggered the notify -> error coming in from ext_messages -> notify loop.

@gbprod
Copy link
Owner

gbprod commented Oct 4, 2022

I understand, thanks for reporting this error :)

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

No branches or pull requests

2 participants