-
Notifications
You must be signed in to change notification settings - Fork 352
[api] update getHistory to call history_v2 #4389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
We can definitely upgrade vite. @jtydhr88 were you able to test vite 7 yet? |
d29562a
to
1b15e98
Compare
Makes sense, I'll leave it outside the scope of this PR for now, since it required a change in vite.config.mts |
1b15e98
to
aabadad
Compare
@christian-byrne previously I tested on vite 6.3.5, and it needs some dependencies upgrade as well, I could send a draft PR for your reference and testing |
@@ -710,13 +712,21 @@ export class ComfyApi extends EventTarget { | |||
max_items: number = 200 | |||
): Promise<{ History: HistoryTaskItem[] }> { | |||
try { | |||
const res = await this.fetchApi(`/history?max_items=${max_items}`) | |||
const json: Promise<HistoryTaskItem[]> = await res.json() | |||
const res = await this.fetchApi(`/history_v2?max_items=${max_items}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this endpoint be added to open-source ComfyUI core server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yessir comfyanonymous/ComfyUI#8844
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay nice. For the discovery, you can also access the version of ComfyUI via /system_stats
or the systemStatsStore
in our codebase. In general we don't worry about supporting old versions of the backend (relative to frontend version) since comfyui_frontend_package is a dependency of ComfyUI and not used with any other backends. However, I may be missing some context.
aabadad
to
2ed47e1
Compare
252b0b6
to
65464c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The only feedback I have is that it wasn't immediately obvious what the actual goal of the PR was - but the link to core PR took care of that. 👍
src/locales/en/settings.json
Outdated
"Comfy_Notification_ShowVersionUpdates": { | ||
"name": "Show version updates", | ||
"tooltip": "Show updates for new models, and major new features." | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ric-yu Feel free to mark as resolved if already resolved - I'm sure I saw this brought up somewhere else.
If not, @christian-byrne can you please confirm this can be ignored after your CI changes?
Backend change needs to happen first |
And this does higlight the need for integration tests again. Issue'd. |
Closing - will just sort history by exec start |
65464c4
to
9a6a1c1
Compare
0371a2a
to
2b72d18
Compare
2b72d18
to
6153e06
Compare
6153e06
to
75faab2
Compare
Stop force-pushing |
Summary
Updates the history API to use a cleaner array format where each history item contains its
prompt_id
as a property rather than being wrapped in anobject with the
prompt_id
as a key.Backend PR: comfyanonymous/ComfyUI#8844
Changes Made
API Response Format Update
{history: [{"prompt_id_1": {...}}, {"prompt_id_2": {...}}]}
{history: [{prompt_id: "prompt_id_1", ...}, {prompt_id: "prompt_id_2", ...}]}
Schema Changes (
src/schemas/apiSchema.ts
)prompt_id
field tozRawHistoryItem
schemazHistoryResponse
to expect a direct array of history items instead of an array of objects with dynamic keysAPI Implementation (
src/scripts/api.ts
)getHistory()
method to use the new/history_v2
endpointprompt_id
is now a direct propertyRawHistoryItem
importTest Coverage (
tests-ui/tests/scripts/api.test.ts
)/history_v2
Test Results
All tests pass successfully, confirming the API correctly handles the new format while maintaining backward compatibility for error scenarios.