PlutoDesktop icon indicating copy to clipboard operation
PlutoDesktop copied to clipboard

Do we need NotebookManager?

Open fonsp opened this issue 2 years ago • 1 comments

The docstring for NotebookManager:

/**
 * It is not possible to 'open' an already open notebook i.e.
 * a notebook that has not been shutdown by Pluto.
 *
 * This manager manages the currently
 * open notebooks and gives us ids of already open notebooks
 * so that we can directly go to the **edit** url.
 */

This is not true: you can open a file that is already open, and Pluto will just send you the ID of the already running notebook.

The Pluto server already keeps track of the list of running notebooks, and it seems error-prone to also keep track of this list in the electron process. We could:

  • Not keep track of it at all, where do we need it? Perhaps we can make a change to Pluto's REST API to avoid this need? E.g. add a header that says notebook-was-already-running: true?
  • If it is necessary somewhere, request the notebook list on demand, without storing the result.

fonsp avatar Jan 16 '23 20:01 fonsp

There are certain features that require this list, but I'd say performing this query on-demand is the best way to go

ctrekker avatar Feb 20 '24 03:02 ctrekker