Skip to content

[Bug]: verso serve never runs notebook post-processors when it opens or saves a notebook #113

Closed

Description

@xkqg

Description

The browser editor that verso serve starts never runs notebook post-processors — not when it opens a file, and not when it saves one.

The extension docs say a post-processor's PostDeserializeAsync transforms the notebook "after deserialization (on open)" and PreSerializeAsync "before serialization (on save)". The VS Code host does exactly that (NotebookHandler asks every post-processor that CanProcess the file after reading it and before writing it), and verso convert does it for the file it reads. The browser editor does not: ServerNotebookService.OpenAsync reads the file with the serializer and goes on without asking any post-processor, and PrepareSerializedContentAsync writes without asking any either. The only place it calls them is the baseline of the Compare view (ServerNotebookService.Diff.cs).

So the same file and the same extensions give a different notebook in the browser than in VS Code. An extension that uses the documented hook to check or adjust a notebook has no effect there, and Verso's own Jupyter post-processors (the Polyglot kernel names, SQL and F# import) are not run on files opened in the browser editor either, by the same path.

What I expected: opening and saving in the browser editor run the post-processors the way the VS Code host does — those for which CanProcess(path, formatId) is true, ordered by Priority.

Steps to Reproduce

  1. Build an extension with one INotebookPostProcessor whose CanProcess returns true and whose PostDeserializeAsync throws (or writes a line to the console).
  2. Open any notebook with it in VS Code: the post-processor runs (the open fails, or the line is written).
  3. Run verso serve some.ipynb --extensions <folder with the extension> and open it in the browser: the notebook opens, and the post-processor was never called. Save it: PreSerializeAsync is not called either.

We met this with our own extension, DeepSharp.Verso.Notebooks 0.5.0: its post-processor refuses to open a Jupyter copy of a notebook of pipeline steps, because Jupyter keeps a step's text but not that it was a step. The VS Code host refuses the file; the browser editor opens it with every step as a raw cell, and its Save then writes a .verso over the original (reported separately).

Error Output

No error: the post-processor is not called, so nothing it would refuse or change happens.

Component

Extension Host / Loading

Frontend

Blazor (standalone)

Verso Version

1.2.2 (verso CLI 1.2.2+d2247170eeaf0914dd9bca7ad410d45bde8cf47f); the same code is on main at 4927f12

.NET Version

10.0.401 (the browser editor runs on .NET 8)

Operating System

Windows 11 Pro (10.0.26200)

Loaded Extensions

DeepSharp.Verso.Notebooks 0.5.0 (any extension with a post-processor shows it)

Severity

High - blocks a workflow, no reasonable workaround

Checklist

  • I searched existing issues and this hasn't been reported yet
  • I can reproduce this with no third-party extensions loaded

Activity

  1. TorreyBetts commented on Oct 1, 2026

    @TorreyBetts
    Contributor

    Thanks for the write up. Every open and save path now runs them the same way the VS Code host does, so a post-processor that refuses a file will refuse it in the browser editor as well. The fix is in #116 and will go out in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions