Page MenuHomePhabricator

D9915.id33379.diff
No OneTemporary

D9915.id33379.diff

diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js
--- a/lib/reducers/master-reducer.js
+++ b/lib/reducers/master-reducer.js
@@ -36,7 +36,6 @@
} from '../types/socket-types.js';
import type { StoreOperations } from '../types/store-ops-types.js';
import { isDev } from '../utils/dev-utils.js';
-import { ashoatKeyserverID } from '../utils/validation-utils.js';
export default function baseReducer<N: BaseNavInfo, T: BaseAppState<N>>(
state: T,
@@ -82,39 +81,43 @@
let keyserverStore = reduceKeyserverStore(state.keyserverStore, action);
if (
- keyserverStore.keyserverInfos[ashoatKeyserverID].connection.status !==
- 'connected' &&
action.type !== incrementalStateSyncActionType &&
action.type !== fullStateSyncActionType &&
action.type !== registerActionTypes.success &&
action.type !== logInActionTypes.success &&
action.type !== siweAuthActionTypes.success
) {
- if (
- messageStore.currentAsOf[ashoatKeyserverID] !==
- state.messageStore.currentAsOf[ashoatKeyserverID]
- ) {
- messageStore = {
- ...messageStore,
- currentAsOf: {
- ...messageStore.currentAsOf,
- [ashoatKeyserverID]:
- state.messageStore.currentAsOf[ashoatKeyserverID],
- },
- };
- }
- if (
- keyserverStore.keyserverInfos[ashoatKeyserverID].updatesCurrentAsOf !==
- state.keyserverStore.keyserverInfos[ashoatKeyserverID].updatesCurrentAsOf
- ) {
- const keyserverInfos = { ...keyserverStore.keyserverInfos };
- keyserverInfos[ashoatKeyserverID] = {
- ...keyserverInfos[ashoatKeyserverID],
- updatesCurrentAsOf:
- state.keyserverStore.keyserverInfos[ashoatKeyserverID]
- .updatesCurrentAsOf,
- };
- keyserverStore = { ...keyserverStore, keyserverInfos };
+ for (const keyserverID in keyserverStore.keyserverInfos) {
+ if (
+ keyserverStore.keyserverInfos[keyserverID].connection.status ===
+ 'connected'
+ ) {
+ continue;
+ }
+ if (
+ messageStore.currentAsOf[keyserverID] !==
+ state.messageStore.currentAsOf[keyserverID]
+ ) {
+ messageStore = {
+ ...messageStore,
+ currentAsOf: {
+ ...messageStore.currentAsOf,
+ [keyserverID]: state.messageStore.currentAsOf[keyserverID],
+ },
+ };
+ }
+ if (
+ keyserverStore.keyserverInfos[keyserverID].updatesCurrentAsOf !==
+ state.keyserverStore.keyserverInfos[keyserverID].updatesCurrentAsOf
+ ) {
+ const keyserverInfos = { ...keyserverStore.keyserverInfos };
+ keyserverInfos[keyserverID] = {
+ ...keyserverInfos[keyserverID],
+ updatesCurrentAsOf:
+ state.keyserverStore.keyserverInfos[keyserverID].updatesCurrentAsOf,
+ };
+ keyserverStore = { ...keyserverStore, keyserverInfos };
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 6, 6:49 PM (21 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2250623
Default Alt Text
D9915.id33379.diff (2 KB)

Event Timeline