Skip to content
Snippets Groups Projects
Commit 0adfa214 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

fixup! Lox integration

Bug 42489: Tidy #attemptUpgrade by returning early with a promise.
parent d66eb707
No related branches found
No related tags found
1 merge request!980Bug 42512: Rebased alpha onto Firefox 115.10.0esr
......@@ -748,23 +748,17 @@ class LoxImpl {
/** Attempts to upgrade the currently saved Lox credential.
* If an upgrade is available, save an event in the event list.
*
* @returns {boolean} whether a levelup event occured
* @returns {boolean} Whether a levelup event occurred.
*/
async #attemptUpgrade(loxId) {
await this.#getPubKeys();
await this.#getEncTable();
await this.#getConstants();
let success = false;
let level = this.#getLevel(loxId);
if (level < 1) {
// attempt trust promotion instead
try {
success = await this.#trustMigration(loxId);
} catch (err) {
lazy.logger.error(err);
return false;
return this.#trustMigration(loxId);
}
} else {
let request = lazy.level_up(
this.#getCredentials(loxId),
this.#encTable,
......@@ -783,15 +777,12 @@ class LoxImpl {
this.#changeCredentials(loxId, cred);
return true;
}
return success;
}
/**
* Attempt to migrate from an untrusted to a trusted Lox credential
*
* @param {string} loxId - The ID to use.
* @returns {Promise<bool>} A bool value indicated whether the credential
* was successfully migrated.
* @returns {boolean} Whether the credential was successfully migrated.
*/
async #trustMigration(loxId) {
await this.#getPubKeys();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment