| author | |
| committer | |
| log | 2ab188f1c0afe99ba269739704e2e96f0bbbe78f |
| tree | 727c2e01bb071decadfc8f93df8276075b5fa96f |
| parent | 9513e62e240bdf1da285e4f3304bc52787125671 |
| signature | Signed by PGP key B5690EEEBB952194 |
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>2 files changed, 15 insertions(+), 1 deletions(-)
apps/web/src/rpc/requestLatencyState.test.ts+10| ... | ... | @@ -59,6 +59,16 @@ describe("requestLatencyState", () => { |
| 59 | 59 | expect(getSlowRpcAckRequests()).toEqual([]); |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | it.each(Object.values(WS_METHODS).filter((method) => method.startsWith("pullRequests.")))( | |
| 63 | "ignores pull request workspace request %s", | |
| 64 | (method) => { | |
| 65 | trackRpcRequestSent("1", method); | |
| 66 | vi.advanceTimersByTime(SLOW_RPC_ACK_THRESHOLD_MS * 2); | |
| 67 | ||
| 68 | expect(getSlowRpcAckRequests()).toEqual([]); | |
| 69 | }, | |
| 70 | ); | |
| 71 | ||
| 62 | 72 | it("keeps ignoring untracked methods when a display tag is supplied", () => { |
| 63 | 73 | trackRpcRequestSent( |
| 64 | 74 | "1", |
apps/web/src/rpc/requestLatencyState.ts+5-1| ... | ... | @@ -49,7 +49,11 @@ function getSlowRpcAckRequestsValue(): ReadonlyArray<SlowRpcAckRequest> { |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | function shouldTrackRpcAck(method: string): boolean { |
| 52 | return !method.includes("subscribe") && !untrackedRpcAckMethods.has(method); | |
| 52 | return ( | |
| 53 | !method.includes("subscribe") && | |
| 54 | !method.startsWith("pullRequests.") && | |
| 55 | !untrackedRpcAckMethods.has(method) | |
| 56 | ); | |
| 53 | 57 | } |
| 54 | 58 | |
| 55 | 59 | function rpcAckThresholdMs(method: string): number { |