Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3345013
D12170.id42688.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D12170.id42688.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12170: [web][keyserver] Use entries from the initial state only if they are missing from the store
Attached
Detach File
Event Timeline
Log In to Comment