@wireapp/core 38.5.2 → 38.5.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"sessionIdMigrator.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/sessionIdMigrator.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAIjD;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAAC,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAqBhG"}
1
+ {"version":3,"file":"sessionIdMigrator.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/proteus/ProteusService/sessionIdMigrator.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AASjD;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAAC,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,iBAgBhG"}
@@ -32,16 +32,14 @@ async function migrateToQualifiedSessionIds(storeEngine, defaultDomain) {
32
32
  const updatedSessions = (await storeEngine.readAll(sessionTableName))
33
33
  .filter(session => !isFullyQualified.test(session.id))
34
34
  .reduce((acc, session) => {
35
- return {
36
- newSessions: [...acc.newSessions, Object.assign(Object.assign({}, session), { id: `${defaultDomain}@${session.id}` })],
37
- oldIds: [...acc.oldIds, session.id],
38
- };
39
- }, { newSessions: [], oldIds: [] });
40
- // In order to change primaryKeys, we need to first delete all the record and re-add them with the new key
41
- for (const oldId of updatedSessions.oldIds) {
35
+ return acc.concat({
36
+ oldId: session.id,
37
+ newSession: Object.assign(Object.assign({}, session), { id: `${defaultDomain}@${session.id}` }),
38
+ });
39
+ }, []);
40
+ for (const { oldId, newSession } of updatedSessions) {
41
+ // In order to change primaryKeys, we need to first delete all the record and re-add them with the new key
42
42
  await storeEngine.delete(sessionTableName, oldId);
43
- }
44
- for (const newSession of updatedSessions.newSessions) {
45
43
  await storeEngine.create(sessionTableName, newSession.id, newSession);
46
44
  }
47
45
  }
package/package.json CHANGED
@@ -60,6 +60,6 @@
60
60
  "test:coverage": "jest --coverage",
61
61
  "watch": "tsc --watch"
62
62
  },
63
- "version": "38.5.2",
64
- "gitHead": "7c355944394145f890f30e5b09882463ed368b4b"
63
+ "version": "38.5.3",
64
+ "gitHead": "31d777ac294e49cd581465cd201b53551de3c37d"
65
65
  }