@jupyter/docprovider 5.0.1 → 5.0.2

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/ydrive.js +10 -10
  2. package/package.json +2 -2
package/lib/ydrive.js CHANGED
@@ -107,6 +107,15 @@ export class RtcContentProvider {
107
107
  documents.push(newPath);
108
108
  (_b = this._globalAwareness) === null || _b === void 0 ? void 0 : _b.setLocalStateField('documents', documents);
109
109
  }
110
+ // Notify the ContentsManager/DocumentContext regardless of whether
111
+ // the rename was first reported by the drive or the shared model.
112
+ // Emitting this also feeds back into the drive signal, but the path
113
+ // check above makes that notification idempotent.
114
+ this._providerFileChanged.emit({
115
+ type: 'rename',
116
+ oldValue: { path: oldPath },
117
+ newValue: { path: newPath }
118
+ });
110
119
  return true;
111
120
  };
112
121
  // The information about file being renamed can come from two places:
@@ -140,16 +149,7 @@ export class RtcContentProvider {
140
149
  }
141
150
  const pathChanges = change.stateChange.filter(change => change.name === 'path');
142
151
  for (const pathChange of pathChanges) {
143
- if (handlePathChange(pathChange)) {
144
- // The drive emits a rename directly in the client that initiated
145
- // it. Other clients learn about it through the shared model, so
146
- // proxy that change to their ContentsManager/DocumentContext too.
147
- this._providerFileChanged.emit({
148
- type: 'rename',
149
- oldValue: { path: pathChange.oldValue },
150
- newValue: { path: pathChange.newValue }
151
- });
152
- }
152
+ handlePathChange(pathChange);
153
153
  }
154
154
  const hashChanges = change.stateChange.filter(change => change.name === 'hash');
155
155
  if (hashChanges.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/docprovider",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "JupyterLab - Document Provider",
5
5
  "homepage": "https://github.com/jupyterlab/jupyter-collaboration",
6
6
  "bugs": {
@@ -41,7 +41,7 @@
41
41
  "watch": "tsc -b --watch"
42
42
  },
43
43
  "dependencies": {
44
- "@jupyter/collaborative-drive": "^5.0.1",
44
+ "@jupyter/collaborative-drive": "^5.0.2",
45
45
  "@jupyter/ydoc": "^4.0.0",
46
46
  "@jupyterlab/apputils": "^4.7.0",
47
47
  "@jupyterlab/cells": "^4.6.0",