diff --git a/crates/lox-library/src/lib.rs b/crates/lox-library/src/lib.rs index 03b9c04..61a82be 100644 --- a/crates/lox-library/src/lib.rs +++ b/crates/lox-library/src/lib.rs @@ -511,6 +511,17 @@ impl BridgeAuth { return res; } } + // Also check the unallocated bridges just in case there is a bridge that should be updated there + let unallocated_bridges = self.bridge_table.unallocated_bridges.clone(); + for (i, unallocated_bridge) in unallocated_bridges.iter().enumerate() { + if unallocated_bridge.uid_fingerprint == bridge.uid_fingerprint { + // Now we must remove the old bridge from the unallocated bridges and insert the new bridge + // in its place + self.bridge_table.unallocated_bridges.remove(i); + self.bridge_table.unallocated_bridges.push(*bridge); + res = true; + } + } // If this is returned, we assume that the bridge wasn't found in the bridge table // and therefore should be treated as a "new bridge" res