Live sessions

A live session is a shared working copy, not a shared snapshot.

The host’s canvas is copied into a shared live room. Everyone in the room applies the same graph edits (create/delete node, edges, moves, stretch). The database only stores who is hosting which graph, seeded from which snapshot. The DAG itself is not written until someone clicks Create Snapshot.

The modal lead says it directly:

Shares your current working copy. Nothing is saved until someone creates a snapshot.

What is being hosted

When you click Start:

  1. You must have an active graph and an active snapshot. Otherwise: “Open a snapshot before going live.”
  2. Pallium records a live_session row with:
    • you as host
    • that graph
    • the snapshot that was selected as seed (seed_snapshot, seed_snapshot_name)
    • audience (invited or members)
    • the invitee user ids
  3. It then uploads whatever is on your canvas right now (get_graph_json()), which may already differ from the seed snapshot if you edited after loading it.

Guests do not load the seed snapshot from the database. They receive the room’s graph (the host’s working copy, plus any edits since). The seed name is only a label: invite copy looks like “{host} has invited you to join a live session of {graph}, {snapshot}.”

You are collaborating on the host’s unsaved copy of that snapshot, forked into a room. The seed snapshot on disk does not change until someone snapshots.

Starting (host)

Go live (top bar) opens the dialog.

  • Tick people in Members (other graph members).
  • Or tick Everyone on this graph — every current member is invited (audience members). Checkboxes in the list disable and all members are included.

Start creates the session, opens the WebSocket, sends init with the canvas JSON, and the button becomes Live (or Live · N).

Toast:

  • members: “You’re live. Graph members can join from Live Sessions.”
  • invited with N people: “You’re live. Invited N people.”
  • invited with nobody else: “You’re live.”

Only the host sees End session and Invite selected. The host does not get a Leave button — leaving without ending would strand the room. End it.

Joining (guest)

Two paths:

  1. Invite modal — if the session audience is invited (not “everyone”), a poll (~4s) plus optional live query notices a new session you can see, you are not the host, and you have not dismissed it. Join or Later. Later suppresses that session id for this page load.
  2. Snapshot picker → Live Sessions — every live session on this graph that the list function returns. Your own session is labeled with the seed snapshot name; someone else’s is {host email} · {seed name}.

Joining:

  • If you have unsaved changes on a different graph, confirm: “You have unsaved changes on another graph. Join the live session anyway?”
  • If you are already in another live session, Pallium leaves that one first.
  • If the session’s graph is not the one you have open, it switches graph (you must still have access) and fetches snapshots without clobbering the snapshot id it is about to replace with the seed id.
  • It opens the WebSocket and sends join. The server replies with state (full graph JSON, dirty flag, peers, host id). Prodigy loads that JSON. If the room is already dirty, your dirty flag is set so you can snapshot later.

Guest lead copy while in-session:

You are in someone else’s live working copy. Leaving keeps the last graph on your canvas so you can snapshot it.

Who can join

The room only accepts:

  • the host, or
  • user ids on the session’s invited list.

Creating with audience members copies all current graph members onto invited. People added to the graph after that moment are not in the room until the host invites them.

The host can Invite selected from the same member list while the session is running (must already be a graph member). That updates both the session record and the live room.

If you are not invited, join fails. If the host already ended, join fails.

What is synced

Everyone sees the same DAG:

  • Create / rename / change role / delete a node
  • Connect or disconnect
  • Drag a node
  • Scale X/Y stretch of the layout

Not synced (local to each browser):

Not synced (local to each browser):

  • SEM, Ego, Cycles, Paths
  • Node size
  • Camera pan/zoom, search focus, selection highlight
  • Light / Zen
  • Analytics mode and hover metrics
  • Who you have selected for Paths

You can be in Paths while a peer is in Ego. You will still see the same nodes and edges.

What the dirty flag means in a room

After the first shared edit, joiners see Create Snapshot enabled so they can save.

Your own structural edits also set dirty locally, same as offline.

Ending (host)

End session is host-only. Guests cannot end the room.

Copy:

Ending disconnects everyone. The last working copy stays on each canvas so anyone can still create a snapshot.

If your canvas is dirty, you get:

  • Cancel
  • End without saving — tear down the room, do not write a snapshot from the host
  • Save snapshot and end — name required (prefilled Live session YYYY-MM-DD HH:MM), writes a snapshot from your canvas, then ends

If your canvas is clean, you just get End session.

Ending:

  1. Sends { type: "end" } on the socket.
  2. Marks the session ended.
  3. Disconnects everyone.
  4. Host’s UI: leave the session id, peer count 0, dirty = true.

Host lead copy while live:

This is your working copy. Ending the session disconnects everyone. Unsaved work stays on each canvas so they can snapshot.

What guests keep when it ends

Guests receive ended and a toast:

The live session has ended. You can still snapshot this copy.

Their Prodigy graph is not cleared and not rewound to the seed snapshot. Dirty is set to true. They can:

  1. Create Snapshot — a personal snapshot on that graph, from the last shared state (plus any ops that landed).
  2. Navigate away (other snapshot, other graph) and lose it.

There is no automatic snapshot for guests. If they do not save, that fork exists only until they load something else.

The same leftover-canvas rule applies if a guest clicks Leave (or the host’s graph picker switches them off the graph). Leave closes the socket, clears the session id, sets dirty, and keeps the graph on the canvas.

Reconnect and presence

If the socket drops while you still think you are in the session, Pallium retries join after 1.5s. The server sends full state again.

Peer count is the number of distinct user ids with an open WebSocket. The Live button shows Live · N when N > 1.

Sessions you can see refresh every few seconds.

Switching context

You do thisLive session
Pick another snapshotLeave, then load that snapshot
Pick another live rowLeave, then join the new room
Pick another graphLeave, clear canvas, load that graph’s lists
End (host)Room dies; canvases kept; dirty
Leave (guest)You disconnect; others stay; your canvas kept; dirty

Snapshot settings stay hidden while you are in a live session so you do not rename the seed while you are actually in a room.