Page MenuHomePhabricator

D12170.id42688.diff
No OneTemporary

D12170.id42688.diff

diff --git a/keyserver/src/responders/redux-state-responders.js b/keyserver/src/responders/redux-state-responders.js
--- a/keyserver/src/responders/redux-state-responders.js
+++ b/keyserver/src/responders/redux-state-responders.js
@@ -58,6 +58,7 @@
userStore: t.maybe(t.Bool),
messageStore: t.maybe(t.Bool),
threadStore: t.maybe(t.Bool),
+ entryStore: t.maybe(t.Bool),
});
export const initialReduxStateRequestValidator: TInterface<InitialReduxStateRequest> =
@@ -214,6 +215,16 @@
lastUserInteractionCalendar: serverUpdatesCurrentAsOf,
};
})();
+ const finalEntryStorePromise = (async () => {
+ if (excludedData.entryStore && useDatabase) {
+ return {
+ entryInfos: {},
+ daysToEntries: {},
+ lastUserInteractionCalendar: 0,
+ };
+ }
+ return await entryStorePromise;
+ })();
const userInfosPromise = (async () => {
const [userInfos, hasNotAcknowledgedPolicies] = await Promise.all([
userInfoPromise,
@@ -349,7 +360,7 @@
await promiseAll({
navInfo: navInfoPromise,
currentUserInfo: currentUserInfoPromise,
- entryStore: entryStorePromise,
+ entryStore: finalEntryStorePromise,
threadStore: threadStorePromise,
userInfos: finalUserInfosPromise,
messageStore: finalMessageStorePromise,
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
@@ -771,7 +771,7 @@
);
}
return {
- entryStore,
+ entryStore: newStore,
entryStoreOperations: [],
reportCreationRequests: [],
};
diff --git a/web/redux/initial-state-gate.js b/web/redux/initial-state-gate.js
--- a/web/redux/initial-state-gate.js
+++ b/web/redux/initial-state-gate.js
@@ -80,6 +80,7 @@
threadStore: !!clientDBStore.threadStore,
messageStore: !!clientDBStore.messages,
userStore: !!clientDBStore.users,
+ entryStore: !!clientDBStore.entries,
},
allUpdatesCurrentAsOf,
});
@@ -144,13 +145,18 @@
];
}
- const entryStoreOperations: Array<EntryStoreOperation> = [
- { type: 'remove_all_entries' },
- ...entries(payload.entryStore.entryInfos).map(([id, entry]) => ({
- type: 'replace_entry',
- payload: { id, entry },
- })),
- ];
+ let entryStoreOperations: Array<EntryStoreOperation> = [];
+ if (clientDBStore.entries) {
+ const { entryStore, ...rest } = initialReduxState;
+ initialReduxState = rest;
+ } else {
+ entryStoreOperations = entries(payload.entryStore.entryInfos).map(
+ ([id, entry]) => ({
+ type: 'replace_entry',
+ payload: { id, entry },
+ }),
+ );
+ }
if (
threadStoreOperations.length > 0 ||
diff --git a/web/types/redux-types.js b/web/types/redux-types.js
--- a/web/types/redux-types.js
+++ b/web/types/redux-types.js
@@ -28,12 +28,14 @@
+threadStore?: ThreadStore,
+userInfos?: UserInfos,
+messageStore?: MessageStore,
+ +entryStore?: EntryStore,
}>;
export type ExcludedData = {
+userStore?: boolean,
+messageStore?: boolean,
+threadStore?: boolean,
+ +entryStore?: boolean,
};
export type InitialReduxStateRequest = {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 5:06 AM (5 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569034
Default Alt Text
D12170.id42688.diff (3 KB)

Event Timeline