@jupyter/docprovider 2.0.0-alpha.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/yprovider.js +4 -5
  2. package/package.json +4 -4
package/lib/yprovider.js CHANGED
@@ -24,9 +24,9 @@ export class WebSocketProvider {
24
24
  */
25
25
  constructor(options) {
26
26
  this._onConnectionClosed = (event) => {
27
- if (event.code >= 4000 && event.code < 4005) {
28
- console.error('Document provider closed:', event.code, event.reason);
29
- showErrorMessage(this._trans.__('Document error'), event.reason, [
27
+ if (event.code === 1003) {
28
+ console.error('Document provider closed:', event.reason);
29
+ showErrorMessage(this._trans.__('Document session error'), event.reason, [
30
30
  Dialog.okButton()
31
31
  ]);
32
32
  // Dispose shared model immediately. Better break the document model,
@@ -89,10 +89,9 @@ export class WebSocketProvider {
89
89
  }
90
90
  async _connect() {
91
91
  const session = await requestDocSession(this._format, this._contentType, this._path);
92
- const params = session.sessionId !== null ? { sessionId: session.sessionId } : undefined;
93
92
  this._yWebsocketProvider = new YWebsocketProvider(this._serverUrl, `${session.format}:${session.type}:${session.fileId}`, this._sharedModel.ydoc, {
94
93
  disableBc: true,
95
- params,
94
+ params: { sessionId: session.sessionId },
96
95
  awareness: this._awareness
97
96
  });
98
97
  this._yWebsocketProvider.on('sync', this._onSync);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0",
4
4
  "description": "JupyterLab - Document Provider",
5
- "homepage": "https://github.com/jupyterlab/jupyter_collaboration",
5
+ "homepage": "https://github.com/jupyterlab/jupyter-collaboration",
6
6
  "bugs": {
7
- "url": "https://github.com/jupyterlab/jupyter_collaboration/issues"
7
+ "url": "https://github.com/jupyterlab/jupyter-collaboration/issues"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/jupyterlab/jupyter_collaboration.git"
11
+ "url": "https://github.com/jupyterlab/jupyter-collaboration.git"
12
12
  },
13
13
  "license": "BSD-3-Clause",
14
14
  "author": "Project Jupyter",