Page MenuHomePhabricator

D12961.diff
No OneTemporary

D12961.diff

diff --git a/lib/reducers/aux-user-reducer.js b/lib/reducers/aux-user-reducer.js
--- a/lib/reducers/aux-user-reducer.js
+++ b/lib/reducers/aux-user-reducer.js
@@ -10,10 +10,17 @@
import {
auxUserStoreOpsHandlers,
type AuxUserStoreOperation,
+ type RemoveAuxUserInfosOperation,
type ReplaceAuxUserInfoOperation,
} from '../ops/aux-user-store-ops.js';
import type { AuxUserStore } from '../types/aux-user-types.js';
import type { BaseAction } from '../types/redux-types';
+import {
+ serverRequestTypes,
+ processServerRequestsActionType,
+} from '../types/request-types.js';
+import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js';
+import { relyingOnAuthoritativeKeyserver } from '../utils/services-utils.js';
const { processStoreOperations: processStoreOps } = auxUserStoreOpsHandlers;
@@ -140,6 +147,45 @@
auxUserStore: processStoreOps(state, replaceOperations),
auxUserStoreOperations: replaceOperations,
};
+ } else if (
+ action.type === processServerRequestsActionType &&
+ relyingOnAuthoritativeKeyserver
+ ) {
+ if (action.payload.keyserverID !== authoritativeKeyserverID()) {
+ return {
+ auxUserStore: state,
+ auxUserStoreOperations: [],
+ };
+ }
+ const checkStateRequest = action.payload.serverRequests.find(
+ candidate => candidate.type === serverRequestTypes.CHECK_STATE,
+ );
+ if (!checkStateRequest || !checkStateRequest.stateChanges) {
+ return {
+ auxUserStore: state,
+ auxUserStoreOperations: [],
+ };
+ }
+ const { deleteUserInfoIDs } = checkStateRequest.stateChanges;
+ if (!deleteUserInfoIDs) {
+ return {
+ auxUserStore: state,
+ auxUserStoreOperations: [],
+ };
+ }
+
+ const removeUsersOps: RemoveAuxUserInfosOperation[] = [];
+ if (deleteUserInfoIDs) {
+ removeUsersOps.push({
+ type: 'remove_aux_user_infos',
+ payload: { ids: deleteUserInfoIDs },
+ });
+ }
+
+ return {
+ auxUserStore: processStoreOps(state, removeUsersOps),
+ auxUserStoreOperations: removeUsersOps,
+ };
}
return {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 1:13 AM (17 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566976
Default Alt Text
D12961.diff (2 KB)

Event Timeline