fix(flow): restore dynamic router handling and downstream reset safety

This commit is contained in:
Hephaestus Bot
2026-04-29 09:57:03 +08:00
parent ba0bf02eeb
commit e322f0ffa6
2 changed files with 152 additions and 106 deletions
+10 -2
View File
@@ -4770,7 +4770,15 @@ function hasSavedProgress(statuses = {}) {
return Object.values({ ...DEFAULT_STATE.stepStatuses, ...statuses }).some((status) => status !== 'pending');
}
function getDownstreamStateResets(step) {
function getDownstreamStateResets(step, state = {}) {
const stepKey = typeof getStepExecutionKeyForState === 'function'
? getStepExecutionKeyForState(step, state)
: String(
typeof getStepDefinitionForState === 'function'
? (getStepDefinitionForState(step, state)?.key || '')
: ''
).trim();
if (step <= 1) {
return {
oauthUrl: null,
@@ -4861,7 +4869,7 @@ async function invalidateDownstreamAfterStepRestart(step, options = {}) {
await addLog(`${logLabel},已重置后续步骤状态:${changedSteps.join(', ')}`, 'warn');
}
const resets = getDownstreamStateResets(step);
const resets = getDownstreamStateResets(step, state);
if (Object.keys(resets).length) {
await setState(resets);
broadcastDataUpdate(resets);