Page MenuHomePhabricator

D12233.diff
No OneTemporary

D12233.diff

diff --git a/lib/keyserver-conn/recovery-utils.js b/lib/keyserver-conn/recovery-utils.js
--- a/lib/keyserver-conn/recovery-utils.js
+++ b/lib/keyserver-conn/recovery-utils.js
@@ -162,10 +162,10 @@
);
// We only need to do a "spot check" on this value below.
- // - To avoid regenerating performRecovery whenever it changes, we want to
- // make sure it's not in that function's dep list.
- // - If we exclude it from that function's dep list, we'll end up binding in
- // the value of preRequestUserState at the time performRecovery is updated.
+ // - To avoid regenerating below callbacks whenever it changes, we want to
+ // make sure it's not in those callbacks' dep lists.
+ // - If we exclude it from those callbacks' dep lists, we'll end up binding in
+ // the value of preRequestUserState at the time the callbacks are updated.
// Instead, by assigning to a ref, we are able to use the latest value.
const preRequestUserStateRef = React.useRef(preRequestUserState);
preRequestUserStateRef.current = preRequestUserState;
@@ -180,7 +180,6 @@
(
source: RecoveryActionSource,
sessionChange: ClientSessionChange,
- userStateBeforeRecovery: PreRequestUserState,
hasBeenCancelled: () => boolean,
) => {
if (hasBeenCancelled()) {
@@ -189,7 +188,7 @@
setNewSession(
dispatch,
sessionChange,
- userStateBeforeRecovery,
+ preRequestUserStateRef.current,
null,
source,
keyserverID,
@@ -236,12 +235,7 @@
!sessionChange.cookie ||
!sessionChange.cookie.startsWith('user=')
) {
- invalidateKeyserverSession(
- source,
- sessionChange,
- userStateBeforeRecovery,
- hasBeenCancelled,
- );
+ invalidateKeyserverSession(source, sessionChange, hasBeenCancelled);
}
} catch (e) {
if (hasBeenCancelled()) {
@@ -254,7 +248,6 @@
invalidateKeyserverSession(
source,
genericCookieInvalidation,
- userStateBeforeRecovery,
hasBeenCancelled,
);
throw e;

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 3:23 PM (22 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576553
Default Alt Text
D12233.diff (2 KB)

Event Timeline