Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf47c30

Browse files
fix: fix script timings spam in the workspace UI (#17590)
Fix#17188We forgot to filter the scripts by `run_on_start`, since we onlycalculate timings in the start phase, which was causing the miss matchbetween the expected script timings count, and the loop in the refetchlogic.While I think this fix is enough for now, I think the server should beresponsible to telling the client when to stop fetching. It could be asimple attribute such as `done: false | true` or a websocket endpoint assuggested by@dannykopping[here](#17188 (comment)).
1 parent14105ff commitdf47c30

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,15 @@ export const WorkspaceReadyPage: FC<WorkspaceReadyPageProps> = ({
166166
// Sometimes, the timings can be fetched before the agent script timings are
167167
// done or saved in the database so we need to conditionally refetch the
168168
// timings. To refetch the timings, I found the best way was to compare the
169-
// expected amount of script timingswith the current amount of script
170-
// timings returned in the response.
169+
// expected amount of script timingsthat run on start, with the current
170+
//amount of scripttimings returned in the response.
171171
refetchInterval:(data)=>{
172172
constexpectedScriptTimingsCount=workspace.latest_build.resources
173173
.flatMap((r)=>r.agents)
174-
.flatMap((a)=>a?.scripts??[]).length;
174+
.flatMap((a)=>a?.scripts??[])
175+
.filter((script)=>script.run_on_start).length;
175176
constcurrentScriptTimingsCount=data?.agent_script_timings?.length??0;
177+
176178
returnexpectedScriptTimingsCount===currentScriptTimingsCount
177179
?false
178180
:1_000;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp