mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 11:01:24 +00:00
fix(browser): land PR #21277 dedupe concurrent relay init
Add shared per-port relay initialization dedupe so concurrent callers await a single startup lifecycle, with regression coverage and changelog entry. Landed from contributor @HOYALIM (PR #21277). Co-authored-by: Ho Lim <subhoya@gmail.com>
This commit is contained in:
@@ -208,6 +208,17 @@ describe("chrome extension relay server", () => {
|
||||
expect(err.message).toContain("401");
|
||||
});
|
||||
|
||||
it("deduplicates concurrent relay starts for the same requested port", async () => {
|
||||
const port = await getFreePort();
|
||||
cdpUrl = `http://127.0.0.1:${port}`;
|
||||
const [first, second] = await Promise.all([
|
||||
ensureChromeExtensionRelayServer({ cdpUrl }),
|
||||
ensureChromeExtensionRelayServer({ cdpUrl }),
|
||||
]);
|
||||
expect(first).toBe(second);
|
||||
expect(first.port).toBe(port);
|
||||
});
|
||||
|
||||
it("allows CORS preflight from chrome-extension origins", async () => {
|
||||
const port = await getFreePort();
|
||||
cdpUrl = `http://127.0.0.1:${port}`;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user