kiyoon / jupynium.nvim

Selenium-automated Jupyter Notebook that is synchronised with NeoVim in real-time.
MIT License
488 stars 15 forks source link

Changes in a last cell crashing the jupynium server and FF tab #125

Open apetrov opened 3 months ago

apetrov commented 3 months ago

Describe the bug There is an assertion in the jupynium server and FF tab crashes when changing the last cell of the ju.py file.

To Reproduce

  1. Create a notebook
  2. Add a several cells
  3. Change the last cell a several time
  4. See error in jupynium

Expected behavior It should not fail.

Logs in /tmp/jupynium/logs/ The tmp directory path can be different in a different OS.
Alternatively, run :JupyniumStartAndAttachToServerInTerminal to see the output directly in neovim.

jupynium.cmds.jupynium: 585 - ERROR - Uncaught exception occurred while processing events. Detaching nvim. Traceback (most recent call last): File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/buffer.py", line 192, in _on_lines_update_buf cell_idx, _, row_within_cell = self.get_cell_index_from_row(start_row) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/buffer.py", line 365, in get_cell_index_from_row raise IndexError(f"Could not find cell for row {row}") IndexError: Could not find cell for row 47 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/cmds/jupynium.py", line 580, in main status, rpcrequest_event = process_events(nvim_info, driver) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/events_control.py", line 225, in process_events status = process_notification_event( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/events_control.py", line 656, in process_notification_event prev_lazy_args_per_buf.lazy_on_lines_event( File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/events_control.py", line 158, in lazy_on_lines_event self.data[bufnr].on_lines_args = lazy_on_lines_event( ^^^^^^^^^^^^^^^^^^^^ File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/events_control.py", line 618, in lazy_on_lines_event process_on_lines_event(nvim_info, driver, bufnr, previous_on_lines) File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/events_control.py", line 627, in process_on_lines_event nvim_info.jupbufs[bufnr].process_on_lines( File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/buffer.py", line 168, in process_on_lines ) = self._on_lines_update_buf(lines, start_row, old_end_row, new_end_row) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/apetrov/projects/vimfiles/.env/lib/python3.11/site-packages/jupynium/buffer.py", line 200, in _on_lines_update_buf assert start_row == old_end_row == self.num_rows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError

Output of jupynium --version

Jupynium v0.2.4

Output of nvim --version


NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info```

**Additional context**
None
kiyoon commented 3 months ago

I can't reproduce this. What system are you on? Does this happen consistently?

Apprently, Jupynium couldn't get updates of neovim buffer correctly but I have no idea why.

apetrov commented 3 months ago

thanks!

macos 14.4.1 firefox 126.0.1 (64-bit)

will try to collect more information when it crashes next time.