Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3342303
D12961.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12961.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12961: [lib] Delete auxUserStore users on authoritative keyserver request
Attached
Detach File
Event Timeline
Log In to Comment