Skip to content

Commit

Permalink
UI showing that the Session Manager is synching. (jupyter-server#347)
Browse files Browse the repository at this point in the history
* tell the user that the sessions are syncing in the UI

* center syncing component on running tab

* if reconnecting after a missed heartbeat, clear the status

* ignore tests for running tab
  • Loading branch information
Zsailer authored and GitHub Enterprise committed May 4, 2022
1 parent 6c16356 commit ab71c9b
Show file tree
Hide file tree
Showing 12 changed files with 12,061 additions and 11,295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ async def poll(self):

# If the kernel is communicating, we're good here.
if km.is_communicating():
if self._attempt_count > 0:
self._emit_status(
status="Connected.",
description="",
)
self._connected_once = True
self._attempt_count = 0
return

now = time.time()
Expand Down
15 changes: 15 additions & 0 deletions data_studio_jupyter_extensions/configurables/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ async def start_kernel_for_session(self, session_id, path, name, type, kernel_na
)
return model

async def list_sessions(self):
self.telemetry_bus.record_event(
schema_name="event.datastudio.jupyter.com/syncing-state",
version=1,
event={"state": "Syncing..."},
)
out = await super().list_sessions()

self.telemetry_bus.record_event(
schema_name="event.datastudio.jupyter.com/syncing-state",
version=1,
event={"state": "Synced."},
)
return out

async def save_session(
self, session_id, path=None, name=None, type=None, kernel_id=None
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ def initialize_configurables(self):
"event.datastudio.jupyter.com/session-message",
"event.datastudio.jupyter.com/kernel-blocked",
"event.datastudio.jupyter.com/kernel-failed",
"event.datastudio.jupyter.com/syncing-state",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$id: event.datastudio.jupyter.com/syncing-state
version: 1
title: Session Syncing State
description: |
Emit a message from the kernel provisioner
type: object
properties:
state:
title: Syncing State
description: |
State of the synchronizer
required:
- state
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ config.coveragePathIgnorePatterns = [
'./test',
'./src/handler.ts',
'./src/utils.ts',
'./src/autostartingkernels.ts'
'./src/autostartingkernels.ts',
'./src/runningtab.ts',
'./src/kernelinfo.tsx'
];
config.coverageThreshold = {
global: {
Expand Down
Loading

0 comments on commit ab71c9b

Please sign in to comment.