mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 992371 - avoid 'A promise chain failed to handle a rejection' errors using FxAccounts. r=jedp
This commit is contained in:
parent
9f1b61fa92
commit
043b20ef46
@ -698,8 +698,14 @@ FxAccountsInternal.prototype = {
|
||||
// Login is truly complete once keys have been fetched, so once getKeys()
|
||||
// obtains and stores kA and kB, it will fire the onverified observer
|
||||
// notification.
|
||||
return this.whenVerified(data)
|
||||
.then(() => this.getKeys());
|
||||
|
||||
// The callers of startVerifiedCheck never consume a returned promise (ie,
|
||||
// this is simply kicking off a background fetch) so we must add a rejection
|
||||
// handler to avoid runtime warnings about the rejection not being handled.
|
||||
this.whenVerified(data).then(
|
||||
() => this.getKeys(),
|
||||
err => log.info("startVerifiedCheck promise was rejected: " + err)
|
||||
);
|
||||
},
|
||||
|
||||
whenVerified: function(data) {
|
||||
|
@ -321,9 +321,16 @@ add_test(function test_fetchAndUnwrapKeys_no_token() {
|
||||
});
|
||||
});
|
||||
|
||||
fxa.setSignedInUser(user).then((user) => {
|
||||
fxa.internal.fetchAndUnwrapKeys();
|
||||
});
|
||||
fxa.setSignedInUser(user).then(
|
||||
user => {
|
||||
return fxa.internal.fetchAndUnwrapKeys();
|
||||
}
|
||||
).then(
|
||||
null,
|
||||
error => {
|
||||
log.info("setSignedInUser correctly rejected");
|
||||
}
|
||||
)
|
||||
});
|
||||
|
||||
// Alice (User A) signs up but never verifies her email. Then Bob (User B)
|
||||
|
Loading…
Reference in New Issue
Block a user