diff --git a/lib/shared/state-sync/current-user-state-sync-spec.js b/lib/shared/state-sync/current-user-state-sync-spec.js --- a/lib/shared/state-sync/current-user-state-sync-spec.js +++ b/lib/shared/state-sync/current-user-state-sync-spec.js @@ -4,13 +4,8 @@ import type { StateSyncSpec } from './state-sync-spec.js'; import type { AppState } from '../../types/redux-types'; -import { - type CurrentUserInfo, - currentUserInfoValidator, -} from '../../types/user-types.js'; -import { convertClientIDsToServerIDs } from '../../utils/conversion-utils.js'; +import { type CurrentUserInfo } from '../../types/user-types.js'; import { hash } from '../../utils/objects.js'; -import { ashoatKeyserverID } from '../../utils/validation-utils.js'; export const currentUserStateSyncSpec: StateSyncSpec< CurrentUserInfo, @@ -18,13 +13,6 @@ void, > = Object.freeze({ hashKey: 'currentUserInfo', - convertClientToServerInfos(info: CurrentUserInfo) { - return convertClientIDsToServerIDs( - ashoatKeyserverID, - currentUserInfoValidator, - info, - ); - }, findStoreInconsistencies() { return undefined; }, diff --git a/lib/shared/state-sync/entries-state-sync-spec.js b/lib/shared/state-sync/entries-state-sync-spec.js --- a/lib/shared/state-sync/entries-state-sync-spec.js +++ b/lib/shared/state-sync/entries-state-sync-spec.js @@ -2,13 +2,11 @@ import _isEqual from 'lodash/fp/isEqual.js'; import { createSelector } from 'reselect'; -import t from 'tcomb'; import type { StateSyncSpec } from './state-sync-spec.js'; import { type CalendarQuery, type RawEntryInfos, - rawEntryInfoValidator, type RawEntryInfo, } from '../../types/entry-types.js'; import type { AppState } from '../../types/redux-types.js'; @@ -19,11 +17,10 @@ import type { ProcessServerRequestAction } from '../../types/request-types.js'; import { actionLogger } from '../../utils/action-logger.js'; import { getConfig } from '../../utils/config.js'; -import { convertClientIDsToServerIDs } from '../../utils/conversion-utils.js'; import { values, combineUnorderedHashes, hash } from '../../utils/objects.js'; import { generateReportID } from '../../utils/report-utils.js'; import { sanitizeActionSecrets } from '../../utils/sanitization.js'; -import { ashoatKeyserverID, tID } from '../../utils/validation-utils.js'; +import { ashoatKeyserverID } from '../../utils/validation-utils.js'; import { filterRawEntryInfosByCalendarQuery, serverEntryInfosObject, @@ -40,21 +37,6 @@ deleteKey: 'deleteEntryIDs', rawInfosKey: 'rawEntryInfos', }, - convertClientToServerInfos( - infos: RawEntryInfos, - calendarQuery: CalendarQuery, - ) { - const filteredEntryInfos = filterRawEntryInfosByCalendarQuery( - serverEntryInfosObject(values(infos)), - calendarQuery, - ); - - return convertClientIDsToServerIDs( - ashoatKeyserverID, - t.dict(tID, rawEntryInfoValidator), - filteredEntryInfos, - ); - }, findStoreInconsistencies( action: ProcessServerRequestAction, beforeStateCheck: RawEntryInfos, diff --git a/lib/shared/state-sync/state-sync-spec.js b/lib/shared/state-sync/state-sync-spec.js --- a/lib/shared/state-sync/state-sync-spec.js +++ b/lib/shared/state-sync/state-sync-spec.js @@ -12,10 +12,6 @@ +rawInfosKey: string, +additionalDeleteCondition?: Info => boolean, }, - +convertClientToServerInfos: ( - infos: Infos, - calendarQuery: CalendarQuery, - ) => Infos, +findStoreInconsistencies: ( action: ProcessServerRequestAction, beforeStateCheck: Infos, diff --git a/lib/shared/state-sync/threads-state-sync-spec.js b/lib/shared/state-sync/threads-state-sync-spec.js --- a/lib/shared/state-sync/threads-state-sync-spec.js +++ b/lib/shared/state-sync/threads-state-sync-spec.js @@ -2,7 +2,6 @@ import _isEqual from 'lodash/fp/isEqual.js'; import { createSelector } from 'reselect'; -import t from 'tcomb'; import type { StateSyncSpec } from './state-sync-spec.js'; import type { AppState } from '../../types/redux-types.js'; @@ -14,15 +13,13 @@ import { type RawThreadInfos, type RawThreadInfo, - rawThreadInfoValidator, } from '../../types/thread-types.js'; import { actionLogger } from '../../utils/action-logger.js'; import { getConfig } from '../../utils/config.js'; -import { convertClientIDsToServerIDs } from '../../utils/conversion-utils.js'; import { combineUnorderedHashes, values } from '../../utils/objects.js'; import { generateReportID } from '../../utils/report-utils.js'; import { sanitizeActionSecrets } from '../../utils/sanitization.js'; -import { ashoatKeyserverID, tID } from '../../utils/validation-utils.js'; +import { ashoatKeyserverID } from '../../utils/validation-utils.js'; export const threadsStateSyncSpec: StateSyncSpec< RawThreadInfos, @@ -35,13 +32,6 @@ deleteKey: 'deleteThreadIDs', rawInfosKey: 'rawThreadInfos', }, - convertClientToServerInfos(infos: RawThreadInfos) { - return convertClientIDsToServerIDs( - ashoatKeyserverID, - t.dict(tID, rawThreadInfoValidator), - infos, - ); - }, findStoreInconsistencies( action: ProcessServerRequestAction, beforeStateCheck: RawThreadInfos, diff --git a/lib/shared/state-sync/users-state-sync-spec.js b/lib/shared/state-sync/users-state-sync-spec.js --- a/lib/shared/state-sync/users-state-sync-spec.js +++ b/lib/shared/state-sync/users-state-sync-spec.js @@ -10,18 +10,12 @@ type UserInconsistencyReportCreationRequest, } from '../../types/report-types.js'; import type { ProcessServerRequestAction } from '../../types/request-types.js'; -import { - type UserInfo, - type UserInfos, - userInfosValidator, -} from '../../types/user-types.js'; +import { type UserInfo, type UserInfos } from '../../types/user-types.js'; import { actionLogger } from '../../utils/action-logger.js'; import { getConfig } from '../../utils/config.js'; -import { convertClientIDsToServerIDs } from '../../utils/conversion-utils.js'; import { combineUnorderedHashes, hash } from '../../utils/objects.js'; import { generateReportID } from '../../utils/report-utils.js'; import { sanitizeActionSecrets } from '../../utils/sanitization.js'; -import { ashoatKeyserverID } from '../../utils/validation-utils.js'; export const usersStateSyncSpec: StateSyncSpec< UserInfos, @@ -37,13 +31,6 @@ return !user.username; }, }, - convertClientToServerInfos(infos: UserInfos) { - return convertClientIDsToServerIDs( - ashoatKeyserverID, - userInfosValidator, - infos, - ); - }, findStoreInconsistencies( action: ProcessServerRequestAction, beforeStateCheck: UserInfos,