fix: ignore pull request actions in latency tracker (#6476)
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
9513e62e24
commit
2ab188f1c0
2 files changed
+15
-1
No files matched your search
@@ -59,6 +59,16 @@ describe("requestLatencyState", () => {
|
||||
expect(getSlowRpcAckRequests()).toEqual([]);
|
||||
});
|
||||
|
||||
it.each(Object.values(WS_METHODS).filter((method) => method.startsWith("pullRequests.")))(
|
||||
"ignores pull request workspace request %s",
|
||||
(method) => {
|
||||
trackRpcRequestSent("1", method);
|
||||
vi.advanceTimersByTime(SLOW_RPC_ACK_THRESHOLD_MS * 2);
|
||||
|
||||
expect(getSlowRpcAckRequests()).toEqual([]);
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps ignoring untracked methods when a display tag is supplied", () => {
|
||||
trackRpcRequestSent(
|
||||
"1",
|
||||
|
||||
@@ -49,7 +49,11 @@ function getSlowRpcAckRequestsValue(): ReadonlyArray<SlowRpcAckRequest> {
|
||||
}
|
||||
|
||||
function shouldTrackRpcAck(method: string): boolean {
|
||||
return !method.includes("subscribe") && !untrackedRpcAckMethods.has(method);
|
||||
return (
|
||||
!method.includes("subscribe") &&
|
||||
!method.startsWith("pullRequests.") &&
|
||||
!untrackedRpcAckMethods.has(method)
|
||||
);
|
||||
}
|
||||
|
||||
function rpcAckThresholdMs(method: string): number {
|
||||
|
||||
Reference in new issue
Block a user