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
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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;
  }

  /**