Skip to content

Commit b8c5203

Browse files
ellisonbgmeeseeksmachine
authored andcommitted
Backport PR #9189: Update session and kernel manager data only if there was a real change.
1 parent bbc2959 commit b8c5203

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

packages/services/src/kernel/manager.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Distributed under the terms of the Modified BSD License.
33

44
import { IIterator, iter, every } from '@lumino/algorithm';
5-
import { JSONExt, JSONObject } from '@lumino/coreutils';
65
import { Poll } from '@lumino/polling';
76
import { ISignal, Signal } from '@lumino/signaling';
87

@@ -257,12 +256,13 @@ export class KernelManager extends BaseManager implements Kernel.IManager {
257256

258257
if (
259258
this._models.size === models.length &&
260-
every(models, x =>
261-
JSONExt.deepEqual(
262-
(this._models.get(x.id) as unknown) as JSONObject,
263-
(x as unknown) as JSONObject
264-
)
265-
)
259+
every(models, x => {
260+
const existing = this._models.get(x.id);
261+
if (!existing) {
262+
return false;
263+
}
264+
return existing.name === x.name;
265+
})
266266
) {
267267
// Identical models list (presuming models does not contain duplicate
268268
// ids), so just return

packages/services/src/session/manager.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Distributed under the terms of the Modified BSD License.
33

44
import { IIterator, iter, every } from '@lumino/algorithm';
5-
import { JSONExt, JSONObject } from '@lumino/coreutils';
65
import { Poll } from '@lumino/polling';
76
import { ISignal, Signal } from '@lumino/signaling';
87

@@ -267,12 +266,19 @@ export class SessionManager extends BaseManager implements Session.IManager {
267266

268267
if (
269268
this._models.size === models.length &&
270-
every(models, x =>
271-
JSONExt.deepEqual(
272-
(this._models.get(x.id) as unknown) as JSONObject,
273-
(x as unknown) as JSONObject
274-
)
275-
)
269+
every(models, x => {
270+
const existing = this._models.get(x.id);
271+
if (!existing) {
272+
return false;
273+
}
274+
return (
275+
existing.kernel?.id === x.kernel?.id &&
276+
existing.kernel?.name === x.kernel?.name &&
277+
existing.name === x.name &&
278+
existing.path === x.path &&
279+
existing.type === x.type
280+
);
281+
})
276282
) {
277283
// Identical models list (presuming models does not contain duplicate
278284
// ids), so just return

0 commit comments

Comments
 (0)