Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3177257
D9800.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9800.diff
View Options
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
@@ -19,6 +19,7 @@
} from '../actions/user-actions.js';
import {
convertUserInfosToReplaceUserOps,
+ type UserStoreOperation,
userStoreOpsHandlers,
} from '../ops/user-store-ops.js';
import { stateSyncSpecs } from '../shared/state-sync/state-sync-specs.js';
@@ -271,18 +272,35 @@
return [state, []];
}
+ const userStoreOps: UserStoreOperation[] = [];
const newUserInfos = { ...state.userInfos };
if (userInfos) {
for (const userInfo of userInfos) {
newUserInfos[userInfo.id] = userInfo;
+ userStoreOps.push({ type: 'replace_user', payload: { ...userInfo } });
}
}
if (deleteUserInfoIDs) {
for (const deleteUserInfoID of deleteUserInfoIDs) {
delete newUserInfos[deleteUserInfoID];
}
+ userStoreOps.push({
+ type: 'remove_users',
+ payload: { ids: deleteUserInfoIDs },
+ });
}
+ const processedUserInfos: UserInfos = processUserStoreOps(
+ state.userInfos,
+ userStoreOps,
+ );
+ assertUserStoresAreEqual(
+ processedUserInfos,
+ newUserInfos,
+ action.type,
+ onStateDifference,
+ );
+
const newInconsistencies = stateSyncSpecs.users.findStoreInconsistencies(
action,
state.userInfos,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 10:47 PM (21 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2446649
Default Alt Text
D9800.diff (1 KB)
Attached To
Mode
D9800: [lib] refactor processing server requests in `UserStore` to ops
Attached
Detach File
Event Timeline
Log In to Comment