Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): VCS status refresh no longer trips the slow-request toast #22159

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/22159/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 22 additions and 16 deletions.

x
0 of 2 viewed, 2 left
16 additions and 13 deletionsapps/web/src/rpc/requestLatencyState.test.tsModified
View file
@@ -80,20 +80,23 @@
expect(getSlowRpcAckRequests()).toEqual([]);
});
​
- it("gives provider updates a longer threshold before warning", () => {
- trackRpcRequestSent("1", WS_METHODS.serverUpdateProvider, "server.updateProvider · env-1");
- vi.advanceTimersByTime(LONG_RUNNING_RPC_ACK_THRESHOLD_MS - 1);
- expect(getSlowRpcAckRequests()).toEqual([]);
+ it.each([WS_METHODS.serverUpdateProvider, WS_METHODS.vcsRefreshStatus])(
+ "gives %s a longer threshold before warning",
+ (method) => {
+ trackRpcRequestSent("1", method, `${method} · env-1`);
+ vi.advanceTimersByTime(LONG_RUNNING_RPC_ACK_THRESHOLD_MS - 1);
+ expect(getSlowRpcAckRequests()).toEqual([]);
​
- vi.advanceTimersByTime(1);
- expect(getSlowRpcAckRequests()).toMatchObject([
- {
- requestId: "1",
- tag: "server.updateProvider · env-1",
- thresholdMs: LONG_RUNNING_RPC_ACK_THRESHOLD_MS,
- },
- ]);
- });
+ vi.advanceTimersByTime(1);
+ expect(getSlowRpcAckRequests()).toMatchObject([
+ {
+ requestId: "1",
+ tag: `${method} · env-1`,
+ thresholdMs: LONG_RUNNING_RPC_ACK_THRESHOLD_MS,