Page MenuHomePhabricator

D10868.diff
No OneTemporary

D10868.diff

diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js
--- a/lib/reducers/calendar-filters-reducer.js
+++ b/lib/reducers/calendar-filters-reducer.js
@@ -13,12 +13,9 @@
} from '../actions/thread-actions.js';
import {
keyserverAuthActionTypes,
- logOutActionTypes,
deleteKeyserverAccountActionTypes,
logInActionTypes,
- tempIdentityLoginActionTypes,
keyserverRegisterActionTypes,
- deleteAccountActionTypes,
} from '../actions/user-actions.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -55,9 +52,6 @@
threadStore: ThreadStore,
): $ReadOnlyArray<CalendarFilter> {
if (
- action.type === tempIdentityLoginActionTypes.success ||
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success ||
action.type === logInActionTypes.success ||
action.type === siweAuthActionTypes.success ||
action.type === keyserverRegisterActionTypes.success
diff --git a/lib/reducers/data-loaded-reducer.js b/lib/reducers/data-loaded-reducer.js
--- a/lib/reducers/data-loaded-reducer.js
+++ b/lib/reducers/data-loaded-reducer.js
@@ -4,7 +4,6 @@
import {
keyserverAuthActionTypes,
logOutActionTypes,
- deleteAccountActionTypes,
logInActionTypes,
} from '../actions/user-actions.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -27,11 +26,7 @@
!usingCommServicesAccessToken
) {
return false;
- } else if (
- action.type === logOutActionTypes.started ||
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
+ } else if (action.type === logOutActionTypes.started) {
return false;
} else if (action.type === keyserverAuthActionTypes.success) {
if (ashoatKeyserverID in action.payload.updatesCurrentAsOf) {
diff --git a/lib/reducers/draft-reducer.js b/lib/reducers/draft-reducer.js
--- a/lib/reducers/draft-reducer.js
+++ b/lib/reducers/draft-reducer.js
@@ -5,11 +5,7 @@
moveDraftActionType,
updateDraftActionType,
} from '../actions/draft-actions.js';
-import {
- deleteKeyserverAccountActionTypes,
- logOutActionTypes,
- deleteAccountActionTypes,
-} from '../actions/user-actions.js';
+import { deleteKeyserverAccountActionTypes } from '../actions/user-actions.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
import type { DraftStore, DraftStoreOperation } from '../types/draft-types.js';
@@ -46,15 +42,7 @@
draftStore: DraftStore,
action: BaseAction,
): ReduceDraftStoreResult {
- if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- return {
- draftStoreOperations: [{ type: 'remove_all' }],
- draftStore: { drafts: {} },
- };
- } else if (action.type === deleteKeyserverAccountActionTypes.success) {
+ if (action.type === deleteKeyserverAccountActionTypes.success) {
return removeKeyserversDraftsFromStore(
draftStore,
action.payload.keyserverIDs,
diff --git a/lib/reducers/enabled-apps-reducer.js b/lib/reducers/enabled-apps-reducer.js
--- a/lib/reducers/enabled-apps-reducer.js
+++ b/lib/reducers/enabled-apps-reducer.js
@@ -1,9 +1,5 @@
// @flow
-import {
- deleteAccountActionTypes,
- logOutActionTypes,
-} from '../actions/user-actions.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
import type { EnabledApps } from '../types/enabled-apps.js';
import {
@@ -27,11 +23,6 @@
action.payload === 'calendar'
) {
return { ...state, calendar: false };
- } else if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- return process.env.BROWSER ? defaultWebEnabledApps : defaultEnabledApps;
} else if (
action.type === setNewSessionActionType &&
action.payload.sessionChange.cookieInvalidated &&
diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js
--- a/lib/reducers/entry-reducer.js
+++ b/lib/reducers/entry-reducer.js
@@ -36,9 +36,7 @@
} from '../actions/thread-actions.js';
import {
keyserverAuthActionTypes,
- logOutActionTypes,
deleteKeyserverAccountActionTypes,
- deleteAccountActionTypes,
logInActionTypes,
} from '../actions/user-actions.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -170,9 +168,7 @@
): [EntryStore, $ReadOnlyArray<ClientEntryInconsistencyReportCreationRequest>] {
const { entryInfos, daysToEntries, lastUserInteractionCalendar } = entryStore;
if (
- action.type === logOutActionTypes.success ||
action.type === deleteKeyserverAccountActionTypes.success ||
- action.type === deleteAccountActionTypes.success ||
action.type === deleteThreadActionTypes.success ||
action.type === leaveThreadActionTypes.success
) {
@@ -180,20 +176,13 @@
const newEntryInfos = _pickBy(
(entry: RawEntryInfo) => authorizedThreadInfos[entry.threadID],
)(entryInfos);
- let newLastUserInteractionCalendar = lastUserInteractionCalendar;
- if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- newLastUserInteractionCalendar = 0;
- }
if (Object.keys(newEntryInfos).length === Object.keys(entryInfos).length) {
return [
{
entryInfos,
daysToEntries,
- lastUserInteractionCalendar: newLastUserInteractionCalendar,
+ lastUserInteractionCalendar,
},
[],
];
@@ -206,7 +195,7 @@
{
entryInfos: newEntryInfos,
daysToEntries: newDaysToEntries,
- lastUserInteractionCalendar: newLastUserInteractionCalendar,
+ lastUserInteractionCalendar,
},
[],
];
diff --git a/lib/reducers/invite-links-reducer.js b/lib/reducers/invite-links-reducer.js
--- a/lib/reducers/invite-links-reducer.js
+++ b/lib/reducers/invite-links-reducer.js
@@ -5,11 +5,7 @@
disableInviteLinkLinkActionTypes,
fetchPrimaryInviteLinkActionTypes,
} from '../actions/link-actions.js';
-import {
- deleteKeyserverAccountActionTypes,
- deleteAccountActionTypes,
- logOutActionTypes,
-} from '../actions/user-actions.js';
+import { deleteKeyserverAccountActionTypes } from '../actions/user-actions.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
import type { InviteLinksStore, CommunityLinks } from '../types/link-types.js';
@@ -72,13 +68,6 @@
...state,
links: newLinks,
};
- } else if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- return {
- links: {},
- };
} else if (
action.type === setNewSessionActionType &&
action.payload.sessionChange.cookieInvalidated
diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -48,10 +48,7 @@
import { updateMultimediaMessageMediaActionType } from '../actions/upload-actions.js';
import {
keyserverAuthActionTypes,
- tempIdentityLoginActionTypes,
- logOutActionTypes,
deleteKeyserverAccountActionTypes,
- deleteAccountActionTypes,
logInActionTypes,
keyserverRegisterActionTypes,
} from '../actions/user-actions.js';
@@ -111,7 +108,6 @@
processUpdatesActionType,
} from '../types/update-types.js';
import { translateClientDBThreadMessageInfos } from '../utils/message-ops-utils.js';
-import { ashoatKeyserverID } from '../utils/validation-utils.js';
const _mapValuesWithKeys = _mapValues.convert({ cap: false });
@@ -765,23 +761,6 @@
messageStoreOperations,
);
- return {
- messageStoreOperations,
- messageStore: {
- ...freshStore,
- messages: processedMessageStore.messages,
- threads: processedMessageStore.threads,
- },
- };
- } else if (action.type === tempIdentityLoginActionTypes.success) {
- const { messageStoreOperations, messageStore: freshStore } =
- freshMessageStore([], {}, { [ashoatKeyserverID]: 0 }, newThreadInfos);
-
- const processedMessageStore = processMessageStoreOperations(
- messageStore,
- messageStoreOperations,
- );
-
return {
messageStoreOperations,
messageStore: {
@@ -874,11 +853,7 @@
{ [action.payload.threadID]: action.payload.truncationStatus },
newThreadInfos,
);
- } else if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success ||
- action.type === deleteKeyserverAccountActionTypes.success
- ) {
+ } else if (action.type === deleteKeyserverAccountActionTypes.success) {
const { messageStoreOperations, messageStore: filteredMessageStore } =
updateMessageStoreWithLatestThreadInfos(messageStore, newThreadInfos);
diff --git a/lib/reducers/policies-reducer.js b/lib/reducers/policies-reducer.js
--- a/lib/reducers/policies-reducer.js
+++ b/lib/reducers/policies-reducer.js
@@ -2,7 +2,6 @@
import { siweAuthActionTypes } from '../actions/siwe-actions.js';
import {
- deleteAccountActionTypes,
logInActionTypes,
logOutActionTypes,
policyAcknowledgmentActionTypes,
@@ -47,11 +46,7 @@
isAcknowledged: true,
},
};
- } else if (
- action.type === logOutActionTypes.started ||
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
+ } else if (action.type === logOutActionTypes.started) {
return {};
}
return state;
diff --git a/lib/reducers/services-access-token-reducer.js b/lib/reducers/services-access-token-reducer.js
--- a/lib/reducers/services-access-token-reducer.js
+++ b/lib/reducers/services-access-token-reducer.js
@@ -2,7 +2,6 @@
import {
logOutActionTypes,
- deleteAccountActionTypes,
setAccessTokenActionType,
} from '../actions/user-actions.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -22,11 +21,7 @@
!usingCommServicesAccessToken
) {
return null;
- } else if (
- action.type === logOutActionTypes.started ||
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
+ } else if (action.type === logOutActionTypes.started) {
return null;
}
return state;
diff --git a/lib/reducers/theme-reducer.js b/lib/reducers/theme-reducer.js
--- a/lib/reducers/theme-reducer.js
+++ b/lib/reducers/theme-reducer.js
@@ -3,10 +3,7 @@
import { siweAuthActionTypes } from '../actions/siwe-actions.js';
import { updateThemeInfoActionType } from '../actions/theme-actions.js';
import {
- logOutActionTypes,
- deleteAccountActionTypes,
logInActionTypes,
- tempIdentityLoginActionTypes,
keyserverRegisterActionTypes,
} from '../actions/user-actions.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -24,7 +21,6 @@
if (
action.type === logInActionTypes.success ||
action.type === siweAuthActionTypes.success ||
- action.type === tempIdentityLoginActionTypes.success ||
action.type === keyserverRegisterActionTypes.success
) {
return defaultGlobalThemeInfo;
@@ -35,12 +31,6 @@
!usingCommServicesAccessToken
) {
return defaultGlobalThemeInfo;
- } else if (
- action.type === logOutActionTypes.started ||
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- return defaultGlobalThemeInfo;
} else if (action.type === updateThemeInfoActionType) {
return {
...state,
diff --git a/lib/reducers/thread-activity-reducer.js b/lib/reducers/thread-activity-reducer.js
--- a/lib/reducers/thread-activity-reducer.js
+++ b/lib/reducers/thread-activity-reducer.js
@@ -14,11 +14,7 @@
newThreadActionTypes,
removeUsersFromThreadActionTypes,
} from '../actions/thread-actions.js';
-import {
- logOutActionTypes,
- deleteKeyserverAccountActionTypes,
- deleteAccountActionTypes,
-} from '../actions/user-actions.js';
+import { deleteKeyserverAccountActionTypes } from '../actions/user-actions.js';
import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
import type { BaseAction } from '../types/redux-types.js';
@@ -104,11 +100,6 @@
}
return updatedState;
- } else if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- return {};
} else if (
action.type === setNewSessionActionType &&
action.payload.sessionChange.cookieInvalidated
diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js
--- a/lib/reducers/thread-reducer.js
+++ b/lib/reducers/thread-reducer.js
@@ -20,12 +20,10 @@
} from '../actions/thread-actions.js';
import {
keyserverAuthActionTypes,
- logOutActionTypes,
deleteKeyserverAccountActionTypes,
logInActionTypes,
keyserverRegisterActionTypes,
updateSubscriptionActionTypes,
- deleteAccountActionTypes,
} from '../actions/user-actions.js';
import { getThreadIDsForKeyservers } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
@@ -133,31 +131,6 @@
newThreadInconsistencies: [],
threadStoreOperations,
};
- } else if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- if (Object.keys(state.threadInfos).length === 0) {
- return {
- threadStore: state,
- newThreadInconsistencies: [],
- threadStoreOperations: [],
- };
- }
- const threadStoreOperations = [
- {
- type: 'remove_all',
- },
- ];
- const updatedThreadStore = processThreadStoreOperations(
- state,
- threadStoreOperations,
- );
- return {
- threadStore: updatedThreadStore,
- newThreadInconsistencies: [],
- threadStoreOperations,
- };
} else if (action.type === deleteKeyserverAccountActionTypes.success) {
const threadIDsToRemove = getThreadIDsForKeyservers(
Object.keys(state.threadInfos),
diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js
--- a/lib/reducers/user-reducer.js
+++ b/lib/reducers/user-reducer.js
@@ -213,34 +213,6 @@
userStoreOps,
];
}
- } else if (
- action.type === logOutActionTypes.success ||
- action.type === deleteAccountActionTypes.success
- ) {
- const userStoreOps: $ReadOnlyArray<UserStoreOperation> = [
- { type: 'remove_all_users' },
- ];
- const processedUserInfos: UserInfos = processUserStoreOps(
- state.userInfos,
- userStoreOps,
- );
- assertUserStoresAreEqual(
- processedUserInfos,
- {},
- action.type,
- onStateDifference,
- );
-
- if (Object.keys(state.userInfos).length === 0) {
- return [state, [], []];
- }
- return [
- {
- userInfos: {},
- },
- [],
- userStoreOps,
- ];
} else if (
action.type === setNewSessionActionType &&
action.payload.sessionChange.cookieInvalidated &&

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 7:01 PM (11 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2492183
Default Alt Text
D10868.diff (15 KB)

Event Timeline