fix: restore Review controls after workflow tab switching
Wait for graph rehydration before history loading and reject stale graph/node results. Preserve real-edit safety guards and saved Take selection. Add lifecycle regressions and bilingual update guidance. Validated with 60 frontend cases, 108 focused CPU tests, five Chrome tab round trips and a Base Seed edit/restore check. GPU continuation was not tested.
This commit is contained in:
+8
-6
@@ -122,18 +122,18 @@ ea64b8e0aa0dda828047c9c12818be8554429774049b9e8c0482c84b9c4f4071 PACKAGE_VALIDA
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
667f2646e82362d472d91a7cf5dc9a86c95f6637f3bc8c672dd516800b1a598c pyproject.toml
|
||||
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
|
||||
53199468f1b5e0e37a70c05a75760af8ec79173be9caec768f3cf7dd554308fd README_JA.md
|
||||
9af0e573be17c93362d2ee0d32953d4fff9c55b767f61ba97ba786960aec62ae README.md
|
||||
2614dd3b3a4680446eeb13d58d67afa59174c804d4249a6149cb137299ed72e2 README_JA.md
|
||||
5970de458c1de8e2477999c42d366963e6c3cfbc22f77e5a56dd862bc824644b README.md
|
||||
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
|
||||
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
|
||||
caa572ea65dafc86850db99f52433d360ac9c4ab36b854292a3dccd5ba32dc76 reference.py
|
||||
4ea6ad5b2613d1da775bb7c6e9af015586322c5cfe152991188dbc7839cf1025 REGISTRY_MANIFEST.sha256
|
||||
eff5802541a47ba93090dbb69610d956cf734da02dfa59af50280578cd7acab3 REGISTRY_MANIFEST.sha256
|
||||
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
|
||||
53827c94b3f588f35bb8eacb404e1bd5e233d25f4ee0fdd286efc7d8ddb52b6f run_storage.py
|
||||
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
|
||||
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
|
||||
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
|
||||
45f5f7479786e2c4c035d5df07b7fd85bcc56710452093c163f120c18f069d09 tests/conftest.py
|
||||
e8badc6a30c3006904944a27e905a02ffd45b3abe63cd1a0e9d97f75a2508ff4 tests/conftest.py
|
||||
7f34c43ea74c43cfc4f9453848c69c8ed7546de5b78c7c7d063d643f2c483c36 tests/decode_cache/conftest.py
|
||||
8d0cced8c945c4333ef78688b51a988d7e1d560e5f9e6cceec8310b17c98ad53 tests/decode_cache/helpers/cache_process_worker.py
|
||||
a41a4de12e6fe5690845f9f0795fa82c4907f0afe2551034fa2a4c95617ac39c tests/decode_cache/test_adapter_nodes.py
|
||||
@@ -142,7 +142,7 @@ a41a4de12e6fe5690845f9f0795fa82c4907f0afe2551034fa2a4c95617ac39c tests/decode_c
|
||||
7e627131904dc6d6f58021fad396185c531858b62dd6febf12c3f95fd1391138 tests/decode_cache/test_store.py
|
||||
db08ce77cc5c5835f2403d4d589394090fa5d25ff3b1840312b2808e1bc203b7 tests/fixtures/v38_a3c_selective_refine_saved_workflow.json
|
||||
606b3985f2b644fac40c84de3e08d1453e87a988acca51ce9595516a7c60a577 tests/frontend_decode_cache_helper.mjs
|
||||
302ef3cf57fe1ab0cd9b7fc97f9201e4c06ab1036fcb1170621b6dfe9b0b7120 tests/frontend_review_queue.cjs
|
||||
19bb25dea15f20fac9874b9d18c9b75156446dda7e6da91e8a9e758282c5f777 tests/frontend_review_queue.cjs
|
||||
36f74c03a40c4b62b90eede070d976bcd1b7f0ea828983d1e61a6cb6d80a0ea8 tests/helpers/r5_process_crash_worker.py
|
||||
706029af8c8d979b2b700f5bc2b96a3064fe7c728f487698d9f079abb02e9409 tests/terminal_merge_diagnostics.py
|
||||
fe23752312d62ddc8c23a3c598ed2f92f2d46e2e4460f06aea91921659092451 tests/test_audit_boundary_repairs.py
|
||||
@@ -374,7 +374,7 @@ fefafd4550511d80bd85ade46a0476f0cf3de13ddb94a908dff6b175f2a0e199 web/easy_bypas
|
||||
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
|
||||
35090816ba7470a7255eb85d003b7e79f8a0065982dacf98a18f41c8ebff655d web/easy_load_video.js
|
||||
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
|
||||
7bdd15370b02a21b0352f9bf3c963b899cbb0a5dc9d142de8784152bb0aab23e web/project_id.js
|
||||
ee8f14ee287422fc913fad7bceee2af412be7cfc5dd62003ddaeff07f2c1ba98 web/project_id.js
|
||||
ae59273f163a116ece418957c557c4fd8c3285e3c60814679b9361d2e6e6fa02 web/reference_audio_ui.js
|
||||
46c9f75c9462bf26300332448f4431cca801f38964ca0a49bc2c50a88a7cc40f web/reference_image_ui.js
|
||||
26b13614ba0a5fd8b192a106c9503b2f4b6fe7f9268a0fcb0f544979a49cab34 v3/video_adapter_nodes.py
|
||||
@@ -412,3 +412,5 @@ f69b734b5bf19fb6db78bbe4737db0bef69c2a6cef2710f28767882ef35ec847 examples/workf
|
||||
3dfd0e7042070f62b9e78239c0e75d82a7df32098db10832465f3049b7f0b38f write-h3-v39-reference-prompts/SKILL.md
|
||||
a9f7b67bd65a9beda622aa5fdc5f8a2ecae1b58b18690d91fb0107a16a3e384e write-h3-v39-reference-prompts/references/simple-3x5.txt
|
||||
81d7b4f4da797339b46911bc96d0a3736d70df29e092715c6684bb1786908593 write-h3-v39-reference-prompts/references/structured.md
|
||||
91ee4adf828415e84e2f413e3a4e20dc16356f139e8ef1f6756f584cad04f3c8 docs/REVIEW_RESTORATION_REPAIR.md
|
||||
d5e255a5fdd06ea18e70f4077f855ed2f02664f91caf79b66bfbdf7df44ad07b tests/test_review_rehydration.py
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
|
||||
*This V3.8X2 card is retained for comparison. Its “CURRENT MAIN” label describes the time it was made; V3.9 is current now. The V3.8 Sampler and V3.8X2 workflow remain available, but their Reference wiring is not automatically converted to V3.9.*
|
||||
|
||||
## Review restoration fix on main (2026-10-01)
|
||||
|
||||
Switching to another workflow and back could hide Review actions even though saved Takes still existed. This frontend repair waits for workflow restoration before reading history and ignores stale results from previous graphs. Real generation-setting changes still disable Review/Take application; restoring the original settings re-enables the actions.
|
||||
|
||||
Update the custom node from `main`, then refresh the browser to load the new JavaScript. Validation: 60/60 frontend regression cases, 108 focused CPU tests, five Chrome tab round trips, and a Chrome Base Seed edit/restore test; saved Take metadata stayed unchanged. Sampling, Run Storage contracts, V3.8X2/V3.9 workflow files and historical Releases are unchanged. GPU continuation was not tested for this repair. [Details and verification limits](docs/REVIEW_RESTORATION_REPAIR.md).
|
||||
|
||||
## Start here: V3.9 and the retained V3.8X2 workflow
|
||||
|
||||
The ComfyUI **Templates → ComfyUI-H3-Continuum** gallery offers two separate entries: the user-selected [V3.9 workflow](examples/workflows/MiniMax_H3_Continuum_V39.json) and [V3.8X2 workflow](examples/workflows/MiniMax_H3_Continuum_V38X2.json). The [V3.8X2 workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip) contains **both unchanged JSON workflows** for one-download setup; the [V3.9 ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip) contains only V3.9. These are workflow archives, not custom-node installers. The V3.8 Sampler remains available, so existing V3.8X2 workflows still load. V3.9 does not automatically convert their Reference connections or saved Runs/Takes: preserve the old workflow and open the dedicated V3.9 graph for new work.
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
|
||||
*V3.8X2の画像も比較用に残しています。画像内の「CURRENT MAIN」は作成当時の表記で、現在の`main`はV3.9です。V3.8 SamplerとV3.8X2 Workflowは利用できますが、Reference配線はV3.9へ自動変換されません。*
|
||||
|
||||
## main更新:Review表示の復元修正(2026-10-01)
|
||||
|
||||
別のWorkflowタブへ切り替えて戻ると、保存済みTakeが残っていてもReview操作が消える問題を修正しました。Workflowの復元完了後に履歴を取得し、古い画面の非同期結果は反映しません。実際に生成設定を変えた場合のReview/Take適用ガードは維持し、元の設定に戻すと操作が復帰します。
|
||||
|
||||
カスタムノードを`main`から更新後、ブラウザーを更新して新しいJavaScriptを読み込んでください。確認済み:Frontend回帰60/60、関連CPU試験108件、Chromeのタブ5往復とBase Seed変更/復元。Take管理データは不変です。Sampling、Run Storage契約、V3.8X2/V3.9のWorkflowファイルと過去Releaseは変更していません。この修正のGPU継続生成は未検証です。[詳細と検証範囲](docs/REVIEW_RESTORATION_REPAIR.md)。
|
||||
|
||||
## 最初に:V3.9とV3.8X2
|
||||
|
||||
ComfyUIの **Templates → ComfyUI-H3-Continuum** には、今回選んだ[V3.9公式Workflow](examples/workflows/MiniMax_H3_Continuum_V39.json)と、別の[V3.8X2 Workflow](examples/workflows/MiniMax_H3_Continuum_V38X2.json)を2件表示します。[V3.8X2 Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip)には、**V3.8X2とV3.9の両JSON**を同梱しました。[V3.9単独ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip)も残します。いずれもWorkflow用ZIPで、カスタムノード本体のインストーラーではありません。V3.8 Samplerは残るので既存のV3.8X2 Workflowは使えます。ただしV3.9へReference配線や保存済みRun/Takeは自動移行しません。旧Workflowを保存しておき、新しい作業ではV3.9専用Workflowを開いてください。
|
||||
|
||||
@@ -35,8 +35,8 @@ ecb65a5dbf9e1683c5a3cadd82daaea3a90a2b776f6ebabfbe8b07aa93177422 nodes.py
|
||||
ea64b8e0aa0dda828047c9c12818be8554429774049b9e8c0482c84b9c4f4071 PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
667f2646e82362d472d91a7cf5dc9a86c95f6637f3bc8c672dd516800b1a598c pyproject.toml
|
||||
53199468f1b5e0e37a70c05a75760af8ec79173be9caec768f3cf7dd554308fd README_JA.md
|
||||
9af0e573be17c93362d2ee0d32953d4fff9c55b767f61ba97ba786960aec62ae README.md
|
||||
2614dd3b3a4680446eeb13d58d67afa59174c804d4249a6149cb137299ed72e2 README_JA.md
|
||||
5970de458c1de8e2477999c42d366963e6c3cfbc22f77e5a56dd862bc824644b README.md
|
||||
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
|
||||
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
|
||||
caa572ea65dafc86850db99f52433d360ac9c4ab36b854292a3dccd5ba32dc76 reference.py
|
||||
@@ -118,7 +118,7 @@ fefafd4550511d80bd85ade46a0476f0cf3de13ddb94a908dff6b175f2a0e199 web/easy_bypas
|
||||
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
|
||||
35090816ba7470a7255eb85d003b7e79f8a0065982dacf98a18f41c8ebff655d web/easy_load_video.js
|
||||
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
|
||||
7bdd15370b02a21b0352f9bf3c963b899cbb0a5dc9d142de8784152bb0aab23e web/project_id.js
|
||||
ee8f14ee287422fc913fad7bceee2af412be7cfc5dd62003ddaeff07f2c1ba98 web/project_id.js
|
||||
ae59273f163a116ece418957c557c4fd8c3285e3c60814679b9361d2e6e6fa02 web/reference_audio_ui.js
|
||||
46c9f75c9462bf26300332448f4431cca801f38964ca0a49bc2c50a88a7cc40f web/reference_image_ui.js
|
||||
26b13614ba0a5fd8b192a106c9503b2f4b6fe7f9268a0fcb0f544979a49cab34 v3/video_adapter_nodes.py
|
||||
@@ -140,3 +140,4 @@ b765b37502b012b462606c4d2dcef43f13950e5fd682824fb18cdb19d542c121 docs/images/v3
|
||||
f69b734b5bf19fb6db78bbe4737db0bef69c2a6cef2710f28767882ef35ec847 examples/workflows/MiniMax_H3_Continuum_V39.zip
|
||||
40199d2500174ba51c040d6983f88d74c4bfbaf19191e728818e6b969b869b0f examples/MiniMax_H3_Continuum_V39.json
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/MiniMax_H3_Continuum_V38X2.json
|
||||
91ee4adf828415e84e2f413e3a4e20dc16356f139e8ef1f6756f584cad04f3c8 docs/REVIEW_RESTORATION_REPAIR.md
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Review restoration after workflow-tab switching
|
||||
|
||||
## What changed
|
||||
|
||||
Returning to a workflow could hide the Review actions or disable Take application while the saved Take data still existed. The frontend could record a settings snapshot before upstream nodes, links and deferred configuration had finished restoring, then mistake the completed restoration for a user edit.
|
||||
|
||||
History loading now waits for graph restoration and the existing deferred configuration passes. Graph/node request guards discard callbacks and responses from obsolete or detached nodes. Initial history reads preserve saved Take-selection fields. Loading and failed-history states have distinct summaries. Transient Review widgets remain excluded from workflow serialization.
|
||||
|
||||
Real generation-setting edits still hide the three Review actions and disable Use This Take / Continue From Here. Returning to the original settings restores these controls. No automatic Take application or generation is performed during restoration.
|
||||
|
||||
## Verified locally
|
||||
|
||||
- Real production JavaScript fixture: 60/60 cases (48 existing plus 12 lifecycle cases). The previous code fails seven cases in the expanded fixture.
|
||||
- Focused CPU tests: 108 passed, no failures; one existing pynvml deprecation warning. This is not a new full CPU suite.
|
||||
- Chrome: five V3.9-copy / V3.8X2-copy / V3.9-copy round trips, with the V3.9 Review actions restored on return to the V3.9 copy. Render History retained its one compatible Take.
|
||||
- Chrome real-edit guard: change Base Seed by one; confirm the three Review actions disappear and Use This Take / Continue From Here are disabled. Restore the original seed; confirm all five controls become enabled again.
|
||||
- Saved workflow and Run project.json hashes remained unchanged after the guard test; no Take was applied and no generation was queued.
|
||||
|
||||
The browser fixture uses a historical Run whose stored generation settings differ from the loaded diagnostic workflow. It validates frontend restoration and edit guarding only, not backend Take compatibility or GPU continuation. Previous/Next remained disabled because the fixture had only one compatible Take.
|
||||
|
||||
## Scope and update
|
||||
|
||||
The runtime change is frontend-only in web/project_id.js. Sampling, Run Storage schemas, State/Session/Assembly contracts, official workflows, package version, historical Releases and Registry publication are unchanged. New regression tests and integrity manifests accompany the fix.
|
||||
|
||||
Update the custom node from main and refresh the browser (hard-refresh if necessary) before testing. If the Review controls still disappear, report the ComfyUI/frontend versions and the exact tab-switch sequence, including whether settings were edited. Do not delete saved Runs or Takes to work around this UI issue.
|
||||
|
||||
No GPU continuation or new GitHub Release / Registry publication was performed for this repair.
|
||||
+1
-1
@@ -37,7 +37,7 @@ def review_queue_results():
|
||||
capture_output=True, text=True, encoding="utf-8", timeout=45,
|
||||
)
|
||||
records = json.loads(result.stdout)
|
||||
assert len(records) == 48, "The complete queue fixture must finish, including V3.9 routing persistence"
|
||||
assert len(records) == 60, "The complete queue fixture must finish, including Workflow rehydration"
|
||||
failures = [item for item in records if not item["pass"]]
|
||||
assert result.returncode == 0 and not failures, result.stdout + result.stderr
|
||||
return {item["name"]: item for item in records}
|
||||
|
||||
@@ -59,7 +59,7 @@ function environment() {
|
||||
vm.runInNewContext(referenceSource+'\n'+src+`\nglobalThis.testFns={configureNode,loadTakeHistory,takeCatalog,selectTakeOffset,selectTakeAction,reviewStatus,reviewSettingsChanged,synchronizeReviewQueue};`,sandbox);
|
||||
app.extension.setup();
|
||||
const f=sandbox.testFns;
|
||||
function makeNode(id=312,run='fixture',nodeClass='H3ContinuumSamplerV38'){
|
||||
function makeNode(id=312,run='fixture',nodeClass='H3ContinuumSamplerV38',configure=true){
|
||||
const v={prompt_mode:'Auto',chunks:3,chunk_seconds:5,aspect:'Auto from First Image',
|
||||
preset:'Draft — 0.30 MP',custom_mp:.3,continuity:'Balanced — 22 frames',base_seed:123,
|
||||
control_after_generate:'fixed',audio_continuity:true,continuation_backend:'Standard',
|
||||
@@ -77,7 +77,7 @@ function environment() {
|
||||
serialize(){return {widgets_values:this.widgets.map(w=>w.value)};},
|
||||
configure(info){info.widgets_values.forEach((v,i)=>{if(this.widgets[i])this.widgets[i].value=v;});}
|
||||
};
|
||||
graph._nodes.push(n);f.configureNode(n);return n;
|
||||
graph._nodes.push(n);if(configure)f.configureNode(n);return n;
|
||||
}
|
||||
const w=(n,name)=>n.widgets.find(w=>w.name===name);
|
||||
async function inputs(n){
|
||||
@@ -91,7 +91,13 @@ function environment() {
|
||||
const result=await api.queuePrompt(0,data,options);
|
||||
for(const x of n.widgets)x.afterQueued?.({isPartialExecution:false});return result;}
|
||||
async function emit(type,detail){await Promise.all((listeners.get(type)||[]).map(cb=>cb({type,detail})));await sleep();await sleep();}
|
||||
async function finishRestore(){
|
||||
await app.extension.afterConfigureGraph();
|
||||
await Promise.all(graph._nodes.map(n=>n.__h3ContinuumHistoryRequest?.promise));
|
||||
await sleep();
|
||||
}
|
||||
return {f,api,app,w,inputs,queue,emit,makeNode,submissions,setSaved:p=>{saved=p;},
|
||||
finishRestore,
|
||||
getSaved:()=>saved,getFetchCount:()=>fetchCount,setQueueHook:h=>queueHook=h,setFetchHook:h=>fetchHook=h,
|
||||
failQueue:e=>nextError=e,visible:(n,name)=>!w(n,name)?.hidden,
|
||||
async load(n,p){saved=p;await f.loadTakeHistory(n,{force:true});n.__h3ContinuumIntuitiveUxRefresh?.();},
|
||||
@@ -569,5 +575,105 @@ await test('V39 loaded node removes only unused old Reference sockets',async e=>
|
||||
assert.deepEqual(n.inputs.map(input=>input.name),['reference_images']);
|
||||
assert.match(e.w(n,'Reference Plan Inspector').value,/Configured only/);
|
||||
});
|
||||
for(const nodeClass of ['H3ContinuumSamplerV38','H3ContinuumSamplerV39']) {
|
||||
await test(`${nodeClass}: recreated tab waits for saved identity and upstream links`,async e=>{
|
||||
const saved=project(1),before=JSON.stringify(saved);e.setSaved(saved);
|
||||
e.app.extension.beforeConfigureGraph?.();
|
||||
const n=e.makeNode(312,'',nodeClass,false);e.app.extension.nodeCreated(n);
|
||||
const reads=e.getFetchCount();
|
||||
e.w(n,'run_name').value='fixture';e.w(n,'generation_mode').value='Review Each Chunk';
|
||||
e.app.extension.loadedGraphNode(n);
|
||||
assert.equal(e.getFetchCount(),reads,'restoration must not fetch a default Run');
|
||||
// Core recreates nodes, then restores upstream nodes and link objects.
|
||||
const source={id:900,comfyClass:'Text',mode:0,widgets:[{name:'text',value:'A quiet scene.'}],inputs:[]};
|
||||
e.app.graph._nodes.push(source);e.app.graph.links[42]={origin_id:900,origin_slot:0};
|
||||
n.inputs.push({name:'sequence_prompt',link:42});await e.finishRestore();
|
||||
assert.equal(n.__h3ContinuumHistoryRun,'fixture');assert(!e.f.reviewSettingsChanged(n));
|
||||
for(const name of ['Use it and continue','Try this chunk again','Use it and finish the rest','Render History'])assert(e.visible(n,name),name);
|
||||
e.w(n,'Render History').callback();assert(e.visible(n,'Use This Take'));assert(!e.w(n,'Use This Take').disabled);
|
||||
assert.equal(JSON.stringify(saved),before);assert.equal(e.submissions.length,0);
|
||||
});
|
||||
}
|
||||
await test('ten rapid recreated tabs reject every obsolete history response',async e=>{
|
||||
const pending=[];e.setFetchHook(url=>new Promise(resolve=>pending.push({url,resolve})));
|
||||
const old=[];
|
||||
for(let i=0;i<10;i++){
|
||||
e.app.extension.beforeConfigureGraph?.();
|
||||
for(const n of e.app.graph._nodes){n.onRemoved?.();old.push(n);}e.app.graph._nodes=[];
|
||||
const n=e.makeNode(312,`run-${i}`,'H3ContinuumSamplerV39',false);
|
||||
e.w(n,'generation_mode').value='Review Each Chunk';e.app.extension.nodeCreated(n);e.app.extension.loadedGraphNode(n);
|
||||
await e.app.extension.afterConfigureGraph();
|
||||
}
|
||||
assert.equal(pending.length,10);
|
||||
const latest=e.app.graph._nodes[0];
|
||||
for(let i=9;i>=0;i--)pending[i].resolve({ok:true,status:200,json:async()=>project(1,3,`r-${i}`,`run-${i}`)});
|
||||
await Promise.all([...old,latest].map(n=>n.__h3ContinuumHistoryRequest?.promise));await sleep();
|
||||
assert.equal(latest.__h3ContinuumTakeProject.canonical_storage_revision_id,'r-9');
|
||||
assert(old.every(n=>!n.__h3ContinuumTakeProject));assert(e.visible(latest,'Use it and continue'));
|
||||
assert.equal(e.submissions.length,0);
|
||||
});
|
||||
await test('API graph restoration without a before hook still reloads history',async e=>{
|
||||
const n=e.makeNode();await e.load(n,null);e.setSaved(project(1));
|
||||
e.w(n,'generation_mode').value='Review Each Chunk';await e.finishRestore();
|
||||
assert(e.visible(n,'Use it and continue'));assert(!e.f.reviewSettingsChanged(n));
|
||||
});
|
||||
await test('manually added sampler loads history after deferred setup',async e=>{
|
||||
e.setSaved(project(1));const n=e.makeNode(312,'fixture','H3ContinuumSamplerV39',false);
|
||||
e.w(n,'generation_mode').value='Review Each Chunk';e.app.extension.nodeCreated(n);
|
||||
assert.equal(e.getFetchCount(),0);await n.__h3ContinuumConfigurePending?.promise;
|
||||
await n.__h3ContinuumHistoryRequest?.promise;await sleep();
|
||||
assert(e.visible(n,'Use it and continue'));
|
||||
});
|
||||
await test('real edits while restored history is pending retain the settings guard',async e=>{
|
||||
let release;e.setFetchHook(()=>new Promise(resolve=>release=resolve));
|
||||
e.app.extension.beforeConfigureGraph?.();const n=e.makeNode(312,'fixture','H3ContinuumSamplerV39',false);
|
||||
e.w(n,'generation_mode').value='Review Each Chunk';e.app.extension.nodeCreated(n);
|
||||
await e.app.extension.afterConfigureGraph();e.w(n,'base_seed').value=999;
|
||||
release({ok:true,status:200,json:async()=>project(1)});await n.__h3ContinuumHistoryRequest?.promise;
|
||||
assert(e.f.reviewSettingsChanged(n));assert(!e.visible(n,'Use it and continue'));
|
||||
});
|
||||
await test('same revision graph refresh cannot erase an existing real edit',async e=>{
|
||||
const n=e.makeNode();e.w(n,'generation_mode').value='Review Each Chunk';await e.load(n,project(1));
|
||||
e.w(n,'base_seed').value=999;await e.finishRestore();
|
||||
assert(e.f.reviewSettingsChanged(n));assert(!e.visible(n,'Use it and continue'));
|
||||
});
|
||||
await test('graph epoch rejects old results even if the same node remains attached',async e=>{
|
||||
const n=e.makeNode();await e.load(n,null);let release;
|
||||
e.setFetchHook(()=>new Promise(resolve=>release=resolve));const request=e.f.loadTakeHistory(n,{force:true});
|
||||
e.app.extension.beforeConfigureGraph?.();
|
||||
release({ok:true,status:200,json:async()=>project(1)});await request;
|
||||
assert(!n.__h3ContinuumTakeProject);
|
||||
e.setFetchHook(null);e.setSaved(project(1));e.w(n,'generation_mode').value='Review Each Chunk';
|
||||
await e.finishRestore();assert(e.visible(n,'Use it and continue'));
|
||||
});
|
||||
await test('removed sampler cancels deferred setup without fetching or mutating it',async e=>{
|
||||
e.setSaved(project(1));const n=e.makeNode(312,'fixture','H3ContinuumSamplerV39',false);
|
||||
e.app.extension.nodeCreated(n);const setup=n.__h3ContinuumConfigurePending?.promise;
|
||||
n.onRemoved();e.app.graph._nodes=[];await setup;
|
||||
assert.equal(e.getFetchCount(),0);assert(!n.__h3ContinuumTakeProject);
|
||||
});
|
||||
await test('initial restored history read preserves saved Take selection fields',async e=>{
|
||||
e.app.extension.beforeConfigureGraph?.();e.setSaved(project(1));
|
||||
const n=e.makeNode(312,'fixture','H3ContinuumSamplerV39',false);e.app.extension.nodeCreated(n);
|
||||
e.w(n,'take_group').value=1;e.w(n,'take_revision_id').value='r1-g1';
|
||||
// One-shot actions are normalized separately by the existing load hook.
|
||||
e.app.extension.loadedGraphNode(n);await e.finishRestore();
|
||||
assert.equal(e.w(n,'take_group').value,1);assert.equal(e.w(n,'take_revision_id').value,'r1-g1');
|
||||
});
|
||||
await test('restored missing or failed history reports accurately and can retry',async e=>{
|
||||
const n=e.makeNode();await e.load(n,null);await e.finishRestore();
|
||||
assert(!n.__h3ContinuumTakeProject);assert(!n.__h3ContinuumTakeError);
|
||||
e.setFetchHook(async()=>({ok:false,status:500}));await e.finishRestore();
|
||||
assert.match(e.w(n,'Ready to Queue').headline,/unavailable/);
|
||||
e.setFetchHook(null);e.setSaved(project(1));e.w(n,'generation_mode').value='Review Each Chunk';
|
||||
await e.finishRestore();assert(e.visible(n,'Use it and continue'));assert(!n.__h3ContinuumTakeError);
|
||||
});
|
||||
await test('failed graph load releases hydration gate for subsequent manual nodes',async e=>{
|
||||
e.app.extension.beforeConfigureGraph?.();e.app.extension.onGraphLoadError?.();
|
||||
e.setSaved(project(1));const n=e.makeNode(312,'fixture','H3ContinuumSamplerV39',false);
|
||||
e.w(n,'generation_mode').value='Review Each Chunk';e.app.extension.nodeCreated(n);
|
||||
await n.__h3ContinuumConfigurePending?.promise;await n.__h3ContinuumHistoryRequest?.promise;await sleep();
|
||||
assert(e.visible(n,'Use it and continue'));
|
||||
});
|
||||
console.log(JSON.stringify(results,null,2));if(results.some(r=>!r.pass))process.exitCode=1;
|
||||
})();
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
"""Exercise real frontend lifecycle hooks with recreated workflow nodes."""
|
||||
|
||||
|
||||
def test_review_workflow_rehydration(review_queue_results):
|
||||
cases = (
|
||||
"H3ContinuumSamplerV38: recreated tab waits for saved identity and upstream links",
|
||||
"H3ContinuumSamplerV39: recreated tab waits for saved identity and upstream links",
|
||||
"ten rapid recreated tabs reject every obsolete history response",
|
||||
"API graph restoration without a before hook still reloads history",
|
||||
"manually added sampler loads history after deferred setup",
|
||||
"real edits while restored history is pending retain the settings guard",
|
||||
"same revision graph refresh cannot erase an existing real edit",
|
||||
"graph epoch rejects old results even if the same node remains attached",
|
||||
"removed sampler cancels deferred setup without fetching or mutating it",
|
||||
"initial restored history read preserves saved Take selection fields",
|
||||
"restored missing or failed history reports accurately and can retry",
|
||||
"failed graph load releases hydration gate for subsequent manual nodes",
|
||||
)
|
||||
for case in cases:
|
||||
assert review_queue_results[case]["pass"]
|
||||
+103
-17
@@ -731,6 +731,17 @@ function readySummary(node) {
|
||||
headline:"Chunk saved — output incomplete", detail:node.__h3ContinuumOutputFailure.message,
|
||||
};
|
||||
if (node.__h3ContinuumQueueNotice) return {headline:"Check saved progress", detail:node.__h3ContinuumQueueNotice};
|
||||
if (findWidget(node, RUN_STORAGE_WIDGET)?.value === "Save + Auto Resume") {
|
||||
if (reviewGraphHydrating || node.__h3ContinuumConfigurePending) return {
|
||||
headline: "Restoring Review", detail: "Waiting for Workflow settings and connections.",
|
||||
};
|
||||
if (node.__h3ContinuumHistoryRequest) return {
|
||||
headline: "Loading saved progress", detail: "Reading this Run's Review and Render History.",
|
||||
};
|
||||
if (node.__h3ContinuumTakeError) return {
|
||||
headline: "Review history unavailable", detail: node.__h3ContinuumTakeError,
|
||||
};
|
||||
}
|
||||
const missing = requiredConnectionNames(node);
|
||||
if (missing.length) {
|
||||
return {
|
||||
@@ -1881,7 +1892,13 @@ function clearTakeSelection(node) {
|
||||
}
|
||||
|
||||
async function loadTakeHistory(node, options = {}) {
|
||||
// Creation precedes saved widget/link restoration. Never bind a Run or
|
||||
// settings baseline to that intermediate graph.
|
||||
if (reviewGraphHydrating || node.__h3ContinuumConfigurePending) return false;
|
||||
if (!reviewNodeAttached(node)) return false;
|
||||
const runName = takeRunName(node);
|
||||
const epoch = reviewGraphEpoch;
|
||||
node.__h3ContinuumTakeInitialLoad = true;
|
||||
const requestedSettings = options.reviewedSettings ?? node.__h3ContinuumReadReviewSettings?.();
|
||||
const identityChanged = node.__h3ContinuumHistoryRun !== runName;
|
||||
if (identityChanged) {
|
||||
@@ -1892,14 +1909,18 @@ async function loadTakeHistory(node, options = {}) {
|
||||
delete node.__h3ContinuumQueueNotice;
|
||||
delete node.__h3ContinuumReviewedSettings;
|
||||
delete node.__h3ContinuumReviewedSettingsKey;
|
||||
clearTakeSelection(node);
|
||||
// The first read must not rewrite a saved explicit Take selection.
|
||||
if (node.__h3ContinuumHistoryRunInitialized) clearTakeSelection(node);
|
||||
node.__h3ContinuumHistoryRunInitialized = true;
|
||||
}
|
||||
if (!options.force && node.__h3ContinuumHistoryRequest?.runName === runName) {
|
||||
return node.__h3ContinuumHistoryRequest.promise;
|
||||
}
|
||||
const token = Number(node.__h3ContinuumTakeLoadToken || 0) + 1;
|
||||
node.__h3ContinuumTakeLoadToken = token;
|
||||
const current = () => node.__h3ContinuumTakeLoadToken === token && takeRunName(node) === runName;
|
||||
const current = () => epoch === reviewGraphEpoch && !reviewGraphHydrating
|
||||
&& reviewNodeAttached(node)
|
||||
&& node.__h3ContinuumTakeLoadToken === token && takeRunName(node) === runName;
|
||||
if (!runName) {
|
||||
node.__h3ContinuumTakeProject = null;
|
||||
delete node.__h3ContinuumTakeError;
|
||||
@@ -1941,13 +1962,19 @@ async function loadTakeHistory(node, options = {}) {
|
||||
node.__h3ContinuumTakeError = String(error?.message || error);
|
||||
return false;
|
||||
} finally {
|
||||
if (current()) node.__h3ContinuumProductionUxRefresh?.();
|
||||
if (current()) {
|
||||
node.__h3ContinuumIntuitiveUxRefresh?.();
|
||||
node.__h3ContinuumProductionUxRefresh?.();
|
||||
}
|
||||
}
|
||||
})();
|
||||
node.__h3ContinuumHistoryRequest = { runName, token, promise };
|
||||
try { return await promise; }
|
||||
finally {
|
||||
if (node.__h3ContinuumHistoryRequest?.token === token) delete node.__h3ContinuumHistoryRequest;
|
||||
if (node.__h3ContinuumHistoryRequest?.token === token) {
|
||||
delete node.__h3ContinuumHistoryRequest;
|
||||
if (current()) node.__h3ContinuumIntuitiveUxRefresh?.();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2601,6 +2628,7 @@ function configureProductionReviewUx(node) {
|
||||
if (!node.__h3ContinuumReviewRemovalGuard) {
|
||||
const previous = node.onRemoved;
|
||||
node.onRemoved = function(...args) {
|
||||
this.__h3ContinuumConfigurePending?.cancel();
|
||||
this.__h3ContinuumTakeLoadToken = Number(this.__h3ContinuumTakeLoadToken || 0) + 1;
|
||||
for (const [id, records] of reviewPrompts) {
|
||||
const remaining = records.filter(record => record.node !== this);
|
||||
@@ -2761,8 +2789,8 @@ function applyV38View(node) {
|
||||
if (!isModernSamplerClass(node.comfyClass)) return;
|
||||
node.__h3ContinuumIntuitiveUxRefresh?.();
|
||||
node.__h3ContinuumProductionUxRefresh?.();
|
||||
if (!node.__h3ContinuumTakeInitialLoad) {
|
||||
node.__h3ContinuumTakeInitialLoad = true;
|
||||
if (!reviewGraphHydrating && !node.__h3ContinuumConfigurePending
|
||||
&& reviewNodeAttached(node) && !node.__h3ContinuumTakeInitialLoad) {
|
||||
void loadTakeHistory(node);
|
||||
}
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
@@ -3231,12 +3259,46 @@ function configureNode(node) {
|
||||
return projectWidget;
|
||||
}
|
||||
|
||||
function configureNodeAfterSetup(node) {
|
||||
configureNode(node);
|
||||
const configureDeferred = () => configureNode(node);
|
||||
setTimeout(configureDeferred, 0);
|
||||
setTimeout(configureDeferred, 100);
|
||||
}
|
||||
let reviewGraphEpoch = 0;
|
||||
let reviewGraphHydrating = false;
|
||||
|
||||
function reviewNodeAttached(node) {
|
||||
const graph = node.graph || app.graph;
|
||||
return Boolean(graph && (graph.getNodeById?.(node.id) === node
|
||||
|| graph._nodes?.includes(node)));
|
||||
}
|
||||
|
||||
function configureNodeAfterSetup(node) {
|
||||
// Coalesce the existing deferred setup passes and expose their completion.
|
||||
// No extra guessed delay: history waits for the actual final setup pass.
|
||||
let pending = node.__h3ContinuumConfigurePending;
|
||||
if (pending?.epoch !== reviewGraphEpoch) {
|
||||
pending?.cancel();
|
||||
const epoch = reviewGraphEpoch;
|
||||
let finish;
|
||||
pending = { epoch, timers: [], promise: new Promise(resolve => { finish = resolve; }) };
|
||||
pending.cancel = () => {
|
||||
for (const timer of pending.timers) clearTimeout(timer);
|
||||
if (node.__h3ContinuumConfigurePending === pending) delete node.__h3ContinuumConfigurePending;
|
||||
finish();
|
||||
};
|
||||
node.__h3ContinuumConfigurePending = pending;
|
||||
for (const delay of [0, 100]) {
|
||||
pending.timers.push(setTimeout(() => {
|
||||
try {
|
||||
if (epoch === reviewGraphEpoch && reviewNodeAttached(node)) configureNode(node);
|
||||
} finally {
|
||||
if (delay === 100) {
|
||||
pending.cancel();
|
||||
if (epoch === reviewGraphEpoch && reviewNodeAttached(node)) applyV38View(node);
|
||||
}
|
||||
}
|
||||
}, delay));
|
||||
}
|
||||
}
|
||||
configureNode(node);
|
||||
return pending.promise;
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "H3Continuum.ProjectId",
|
||||
@@ -3282,7 +3344,19 @@ app.registerExtension({
|
||||
});
|
||||
},
|
||||
|
||||
nodeCreated(node) {
|
||||
beforeConfigureGraph() {
|
||||
reviewGraphEpoch++;
|
||||
reviewGraphHydrating = true;
|
||||
for (const node of app.graph?._nodes || []) node.__h3ContinuumConfigurePending?.cancel();
|
||||
},
|
||||
|
||||
onGraphLoadError() {
|
||||
reviewGraphEpoch++;
|
||||
reviewGraphHydrating = false;
|
||||
for (const node of app.graph?._nodes || []) node.__h3ContinuumConfigurePending?.cancel();
|
||||
},
|
||||
|
||||
nodeCreated(node) {
|
||||
configureNodeAfterSetup(node);
|
||||
},
|
||||
|
||||
@@ -3294,11 +3368,23 @@ app.registerExtension({
|
||||
configureNodeAfterSetup(node);
|
||||
},
|
||||
|
||||
afterConfigureGraph() {
|
||||
for (const node of [...(app.graph?._nodes || [])]) {
|
||||
async afterConfigureGraph() {
|
||||
// API graph loading can call this hook without beforeConfigureGraph.
|
||||
const epoch = reviewGraphEpoch;
|
||||
reviewGraphHydrating = true;
|
||||
const nodes = [...(app.graph?._nodes || [])];
|
||||
const pending = [];
|
||||
for (const node of nodes) {
|
||||
migrateReferenceImageInputs(node);
|
||||
configureNodeAfterSetup(node);
|
||||
}
|
||||
pending.push(configureNodeAfterSetup(node));
|
||||
}
|
||||
await Promise.all(pending);
|
||||
if (epoch !== reviewGraphEpoch) return;
|
||||
reviewGraphHydrating = false;
|
||||
for (const node of nodes) {
|
||||
if (!isModernSamplerClass(node.comfyClass) || !reviewNodeAttached(node)) continue;
|
||||
void loadTakeHistory(node, { force: true, reviewedSettings: reviewSettingsSnapshot(node) });
|
||||
}
|
||||
},
|
||||
|
||||
async beforeQueuePrompt(prompt) {
|
||||
|
||||
Reference in New Issue
Block a user