From 04cf3f3630e691525f7f39e64e5f28eb23fcac3e Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 20 Sep 2018 12:24:07 +0200 Subject: [PATCH] openvidu-node-client: sort active connections by creation time when fetched --- openvidu-node-client/src/Session.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openvidu-node-client/src/Session.ts b/openvidu-node-client/src/Session.ts index d2882683..52fe881f 100644 --- a/openvidu-node-client/src/Session.ts +++ b/openvidu-node-client/src/Session.ts @@ -472,6 +472,8 @@ export class Session { publishers, subscribers)); }); + // Order connections by time of creation + this.activeConnections.sort((c1, c2) => (c1.createdAt > c2.createdAt) ? 1 : ((c2.createdAt > c1.createdAt) ? -1 : 0)); return this; }