fix: preserve subgraph instance context on cached node reuse, deduplicate workflow analysis requests, and configure context menu for dynamic nodes

This commit is contained in:
Dariusz L
2026-08-03 19:05:32 +02:00
parent da76170abc
commit db76a45b1b
10 changed files with 233 additions and 25 deletions
+12 -8
View File
@@ -201,8 +201,12 @@ export const lifecycleGraphMethods = {
return data;
}
const analysisId = `an-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
this._analysisProgressToken = analysisId;
const analysisRequest = this.getWorkflowAnalysisRequest(workflow, {
forceRescan: Boolean(forceRescan),
});
if (!analysisRequest) return null;
this._analysisProgressToken = analysisRequest.analysisId;
if (!preserveContent && shouldRenderMissingModels()) {
this.contentElement.innerHTML = this.renderAnalysisProgress({
status: 'starting',
@@ -215,15 +219,15 @@ export const lifecycleGraphMethods = {
// Call analyze endpoint
const progressPromise = preserveContent
? Promise.resolve()
: this.pollAnalysisProgress(analysisId, analysisId);
: this.pollAnalysisProgress(
analysisRequest.analysisId,
analysisRequest.analysisId
);
let data;
try {
data = await this.fetchJson('/model_resolver/analyze', {
method: 'POST',
body: JSON.stringify({ workflow, analysis_id: analysisId, force_rescan: Boolean(forceRescan) })
}, 'Analyze workflow');
data = await analysisRequest.promise;
} finally {
if (this._analysisProgressToken === analysisId) {
if (this._analysisProgressToken === analysisRequest.analysisId) {
this._analysisProgressToken = null;
}
await progressPromise;