diff --git a/test/browser/connection.test.js b/test/browser/connection.test.js index 54a08a519..83bf5e14d 100644 --- a/test/browser/connection.test.js +++ b/test/browser/connection.test.js @@ -213,10 +213,19 @@ define(['shared_helper', 'chai'], function (Helper, chai) { }); }); + function connectionID(key) { + const s = key.split('-')[0]; + if (s.includes('!')) { + /* skip the instance id */ + return s.split('!')[1]; + } + return s; + } + /* uses internal realtime knowledge of the format of the connection key to * check if a connection key is the result of a successful recovery of another */ function sameConnection(keyA, keyB) { - return keyA.split('-')[0] === keyB.split('-')[0]; + return connectionID(keyA) === connectionID(keyB); } /**