Skip to content

Harmonize POST API vs jupyverse? #42

@cben

Description

@cben

I was trying to make jpterm work with this server, and discovered the HTTP API adopted here vs. the one adopted by jupyverse are different.

  • jupyter-server-nbmodel sends nested
    { code, metadata: { cell_id, document_id, record_timing } }.
    Parsed here then here; code snippet is mandatory.

    There is also additional GET .../requests/<taskid> API for polling,
    plus POST .../input API for input().

  • jupyverse client sends sends flat { cell_id, document_id }.
    Server looks up the code itself from its Y model.

The nested/flat is cosmetic but the 2 code approaches are an interesting tradeoff! 🤔

  • race condition: In collaborative editing, if I Shift+Enter a cell you're editing but my client didn't sync it yet, jupyverse risks executing new code different from what old code I intended to run?
    OTOH this extension will execute precisely what I saw — but then notebook syncs with new code, risking showing results that don't match the code? Will final notebook mark cell as out-of-date in such scenario?

Dunno what are the long-term plans, but figured I'll document the difference.

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