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

fixup! Lox integration

Bug 42489: Generated loxId is unlikely to clash with existing ones, but
we add some free logic to guarantee this.
parent 64b8d301
Branches
Tags
1 merge request!980Bug 42512: Rebased alpha onto Firefox 115.10.0esr
......@@ -488,7 +488,6 @@ class LoxImpl {
}
await this.#getPubKeys();
let request = await lazy.open_invite(JSON.parse(invite).invite);
let id = this.#genLoxId();
let response;
try {
response = await this.#makeRequest(
......@@ -507,9 +506,15 @@ class LoxImpl {
JSON.stringify(response),
this.#pubKeys
);
this.#credentials[id] = cred;
// Generate an id that is not already in the #credentials map.
let loxId;
do {
loxId = this.#genLoxId();
} while (Object.hasOwn(this.#credentials, loxId));
// Set new credentials.
this.#credentials[loxId] = cred;
this.#store();
return id;
return loxId;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment