Page MenuHomePhabricator

D11654.diff
No OneTemporary

D11654.diff

diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js
--- a/lib/reducers/keyserver-reducer.js
+++ b/lib/reducers/keyserver-reducer.js
@@ -444,11 +444,24 @@
action.payload.userID !== action.payload.preRequestUserState?.id)
) {
// We want to remove all keyservers but Ashoat's keyserver
- const oldConnection =
- state.keyserverInfos[authoritativeKeyserverID()].connection;
+ const oldKeyserverInfo = state.keyserverInfos[authoritativeKeyserverID()];
+ const oldConnection = oldKeyserverInfo.connection;
const operations: KeyserverStoreOperation[] = [
{ type: 'remove_all_keyservers' },
];
+
+ let cookie = oldKeyserverInfo.cookie;
+ if (
+ action.type === logOutActionTypes.success ||
+ action.type === deleteAccountActionTypes.success ||
+ cookie?.startsWith('user=')
+ ) {
+ // To avoid unnecessary rerenders, we won't clear the authoritative
+ // keyserver's cookie unless it's a logout or an account deletion, or if
+ // the cookie belongs to an actual user (as opposed to an anonymous one)
+ cookie = null;
+ }
+
operations.push({
type: 'replace_keyserver',
payload: {
@@ -465,7 +478,7 @@
queuedActivityUpdates: [],
lateResponses: [],
},
- cookie: null,
+ cookie,
},
},
});

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 10:09 AM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611288
Default Alt Text
D11654.diff (1 KB)

Event Timeline