fix matchmaking session startup forwarding
This commit is contained in:
@@ -33,6 +33,12 @@ try {
|
|||||||
assert.ok(calls[0]?.url.endsWith("/a2a/tasks"));
|
assert.ok(calls[0]?.url.endsWith("/a2a/tasks"));
|
||||||
assert.equal(calls[0]?.headers.get("authorization"), config.a2aAllowedKey ? `Bearer ${config.a2aAllowedKey}` : null);
|
assert.equal(calls[0]?.headers.get("authorization"), config.a2aAllowedKey ? `Bearer ${config.a2aAllowedKey}` : null);
|
||||||
|
|
||||||
|
calls.length = 0;
|
||||||
|
const sessionStartResponse = await app.request("http://backend.test/matchmaking/a2a", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ action: "session_start", params: { page: "job-matching" } }) });
|
||||||
|
assert.equal(sessionStartResponse.status, 200);
|
||||||
|
assert.equal(calls[0]?.body.action, "session_start");
|
||||||
|
assert.equal(calls[0]?.body.session_start, true);
|
||||||
|
|
||||||
const forbiddenResponse = await app.request("http://backend.test/matchmaking/a2a", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ action: "force_forbidden" }) });
|
const forbiddenResponse = await app.request("http://backend.test/matchmaking/a2a", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ action: "force_forbidden" }) });
|
||||||
assert.equal(forbiddenResponse.status, 502);
|
assert.equal(forbiddenResponse.status, 502);
|
||||||
assert.match(await forbiddenResponse.text(), /matchmaking service authentication failed/);
|
assert.match(await forbiddenResponse.text(), /matchmaking service authentication failed/);
|
||||||
|
|||||||
@@ -388,6 +388,7 @@ async function callMatchmakingA2a(body: Record<string, unknown>, userId: string)
|
|||||||
...body,
|
...body,
|
||||||
action: action === "get_feed" ? "get_scout_feed" : action,
|
action: action === "get_feed" ? "get_scout_feed" : action,
|
||||||
user_id: getString(body.user_id) ?? userId,
|
user_id: getString(body.user_id) ?? userId,
|
||||||
|
session_start: action === "session_start" || body.session_start === true,
|
||||||
};
|
};
|
||||||
const startedAt = Date.now();
|
const startedAt = Date.now();
|
||||||
let res: Response;
|
let res: Response;
|
||||||
|
|||||||
Reference in New Issue
Block a user