Added logs to track the issues, started doing changes based on the school api project
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Ankitkumar Satapara
2026-04-24 00:44:57 +05:30
parent baa7ae5579
commit 5cf8dd32a2
3 changed files with 87 additions and 5 deletions

View File

@@ -198,7 +198,7 @@ namespace Nodify.Calculator.Execution.Handlers
var bodyNode = loopBodyConnection?.Input?.Operation;
if (bodyNode != null)
ctx.Executor.TraverseChainPublic(bodyNode, "end", ctx.Connections, new HashSet<string>(), true);
ctx.Executor.ExecuteLinearChain(bodyNode, ctx.Connections);
}
ctx.Log($"[FOREACH] Loop completed. {array.Count} iterations executed.");
}

View File

@@ -56,13 +56,35 @@ namespace Nodify.Calculator.Execution.Resolvers
{
// Split's model input is the Square-shaped connector
var modelInput = node.Input.FirstOrDefault(i => i.Shape == ConnectorShape.Square);
if (modelInput == null) return null;
if (modelInput == null)
{
ctx.Log("[SPLIT] No Square input connector found.", logType.Warning);
return null;
}
var modelJson = ctx.Read(modelInput);
ctx.Log($"[SPLIT] Input JSON: {(modelJson?.Length > 120 ? modelJson.Substring(0, 120) + "..." : modelJson ?? "(null)")}");
if (string.IsNullOrWhiteSpace(modelJson)) return null;
var propName = ResolverUtils.NormalizeConnectorName(outputConnector.Title);
return ResolverUtils.ExtractJsonProperty(modelJson, propName);
ctx.Log($"[SPLIT] Looking for property: \"{propName}\"");
// Try direct property extraction first
var result = ResolverUtils.ExtractJsonProperty(modelJson, propName);
// If not found at top level, try unwrapping a "data" envelope
if (result == null)
{
var dataInner = ResolverUtils.ExtractJsonProperty(modelJson, "data");
if (!string.IsNullOrWhiteSpace(dataInner))
{
ctx.Log("[SPLIT] Property not found at top level, unwrapping \"data\" envelope...");
result = ResolverUtils.ExtractJsonProperty(dataInner, propName);
}
}
ctx.Log($"[SPLIT] Resolved \"{propName}\" = {result ?? "(null)"}");
return result;
}
}