Page MenuHomePhorge

D7852.1768450205.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D7852.1768450205.diff

diff --git a/lib/selectors/socket-selectors.js b/lib/selectors/socket-selectors.js
--- a/lib/selectors/socket-selectors.js
+++ b/lib/selectors/socket-selectors.js
@@ -1,6 +1,7 @@
// @flow
import { createSelector } from 'reselect';
+import t from 'tcomb';
import { currentCalendarQuery } from './nav-selectors.js';
import {
@@ -10,7 +11,11 @@
} from '../shared/entry-utils.js';
import threadWatcher from '../shared/thread-watcher.js';
import type { SignedIdentityKeysBlob } from '../types/crypto-types.js';
-import type { RawEntryInfo, CalendarQuery } from '../types/entry-types.js';
+import {
+ type RawEntryInfo,
+ rawEntryInfoValidator,
+ type CalendarQuery,
+} from '../types/entry-types.js';
import type { AppState } from '../types/redux-types.js';
import type { ClientReportCreationRequest } from '../types/report-types.js';
import {
@@ -20,11 +25,25 @@
} from '../types/request-types.js';
import type { SessionState } from '../types/session-types.js';
import type { OneTimeKeyGenerator } from '../types/socket-types.js';
-import type { RawThreadInfo } from '../types/thread-types.js';
-import type { CurrentUserInfo, UserInfos } from '../types/user-types.js';
+import {
+ type RawThreadInfo,
+ rawThreadInfoValidator,
+} from '../types/thread-types.js';
+import {
+ type CurrentUserInfo,
+ currentUserInfoValidator,
+ type UserInfos,
+ userInfosValidator,
+} from '../types/user-types.js';
import { getConfig } from '../utils/config.js';
import { minimumOneTimeKeysRequired } from '../utils/crypto-utils.js';
import { values, hash } from '../utils/objects.js';
+import {
+ tID,
+ convertClientIDsToServerIDs,
+ keyserverPrefixID,
+ convertToNewIDSchema,
+} from '../utils/validation-utils.js';
const queuedReports: (
state: AppState,
@@ -80,10 +99,34 @@
platformDetails: getConfig().platformDetails,
});
} else if (serverRequest.type === serverRequestTypes.CHECK_STATE) {
- const filteredEntryInfos = filterRawEntryInfosByCalendarQuery(
+ let filteredEntryInfos = filterRawEntryInfosByCalendarQuery(
serverEntryInfosObject(values(entryInfos)),
calendarQuery(calendarActive),
);
+
+ if (convertToNewIDSchema) {
+ threadInfos = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ t.dict(tID, rawThreadInfoValidator),
+ threadInfos,
+ );
+ userInfos = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ userInfosValidator,
+ userInfos,
+ );
+ currentUserInfo = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ t.maybe(currentUserInfoValidator),
+ currentUserInfo,
+ );
+ filteredEntryInfos = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ t.dict(tID, rawEntryInfoValidator),
+ filteredEntryInfos,
+ );
+ }
+
const hashResults = {};
for (const key in serverRequest.hashesToCheck) {
const expectedHashValue = serverRequest.hashesToCheck[key];

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 15, 4:10 AM (5 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5935850
Default Alt Text
D7852.1768450205.diff (3 KB)

Event Timeline