Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2840558
D11800.id39543.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
D11800.id39543.diff
View Options
diff --git a/lib/selectors/socket-selectors.js b/lib/selectors/socket-selectors.js
--- a/lib/selectors/socket-selectors.js
+++ b/lib/selectors/socket-selectors.js
@@ -147,8 +147,12 @@
const hashResults: { [string]: boolean } = {};
for (const key in serverRequest.hashesToCheck) {
const expectedHashValue = serverRequest.hashesToCheck[key];
- let hashValue;
const [specKey, id] = key.split('|');
+ if (specPerInnerHashKey[specKey]?.hashingInProgress) {
+ hashResults[key] = true;
+ continue;
+ }
+ let hashValue;
if (id) {
hashValue = specPerInnerHashKey[specKey]?.getInfoHash(
id,
@@ -161,11 +165,7 @@
);
}
- // If hashValue values is null then we are still calculating
- // the hashes in the background. In this case we return true
- // to skip this state check. Future state checks (after the hash
- // calculation complete) will be handled normally.
- // Another case when this is null is when we are handling state
+ // The hashValue is null when we are handling state
// sync with a non-authoritative keyserver. We don't want to sync
// user store and current user info with such keyservers.
if (!hashValue) {
diff --git a/lib/shared/state-sync/state-sync-spec.js b/lib/shared/state-sync/state-sync-spec.js
--- a/lib/shared/state-sync/state-sync-spec.js
+++ b/lib/shared/state-sync/state-sync-spec.js
@@ -31,5 +31,6 @@
+getInfoHash: (id: string, keyserverID: string) => ?number,
+getAllInfosHash: (query: CalendarQuery, keyserverID: string) => ?number,
+getIDs: (query: CalendarQuery, keyserverID: string) => ?Array<string>,
+ +hashingInProgress?: boolean,
...StateSyncSpec<Infos, Info, Inconsistencies>,
};
diff --git a/lib/shared/state-sync/threads-state-sync-spec.js b/lib/shared/state-sync/threads-state-sync-spec.js
--- a/lib/shared/state-sync/threads-state-sync-spec.js
+++ b/lib/shared/state-sync/threads-state-sync-spec.js
@@ -51,6 +51,7 @@
.filter(id => extractKeyserverIDFromID(id) === keyserverID)
.map(id => id.split('|')[1])
: () => null,
+ hashingInProgress: threadHashingComplete,
}),
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 30, 6:17 AM (21 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2204052
Default Alt Text
D11800.id39543.diff (2 KB)
Attached To
Mode
D11800: [lib] Properly handle hashing in progress
Attached
Detach File
Event Timeline
Log In to Comment