Skip to content

Fix trigger DAG form submitting stale config when reusing a previous run#65360

Open
seruman wants to merge 3 commits intoapache:mainfrom
seruman:fix-prefilled-trigger-dag-from
Open

Fix trigger DAG form submitting stale config when reusing a previous run#65360
seruman wants to merge 3 commits intoapache:mainfrom
seruman:fix-prefilled-trigger-dag-from

Conversation

@seruman
Copy link
Copy Markdown

@seruman seruman commented Apr 16, 2026

When using Trigger again with this config, edits made to params via the Run Parameters form fields are silently discarded on submit. The form sends the original prefilled values instead. Editing the JSON directly in Advanced Options works fine, only form field edits are lost.

The useEffect that propagates Zustand store changes back to react-hook-form had a !prefillConfig guard, added in #56406 alongside the prefill feature. My guess is this was meant to prevent the sync effect from overwriting the prefilled values with default conf before the prefill effect had a chance to run. Makes sense as a precaution, but it also blocks all subsequent store updates like user edits from reaching the form's conf field. 1

Removing the guard means the sync effect now also fires during the initial prefill, right after the prefill effect calls setConf. This should be a no-op2 since both effects end up with the same conf value, the prefill effect does a full reset(...) and then setConf(confString), and the sync effect picks up that same confString and does reset(prev => ({...prev, conf})) which changes nothing.

So the initial render looks fine, and subsequent edits now should propagate correctly.

closes: #65357


Was generative AI tooling used to co-author this PR?
  • Yes

Generated-by: pi (Claude Opus 4.6) following the guidelines

Note

I was already suspecting a state mismatch, used it to find the relevant code and confirm the hypothesis. Rest of the component changes are on me. Also had a little help mocking out the stuff like Monaco editor and the i18n stuff.


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Footnotes

  1. I might be missing the real reason behind the guard but on my tests removing did not introduced any issues.

  2. 🤞

When retriggering a DAG with prefilled config from a previous run, edits
made via the Run Parameters form fields were not synced back to
react-hook-form's conf field. The useEffect that syncs the Zustand store
conf to the form skipped updates when prefillConfig was set, so the
submitted conf was always the original prefilled value.

Remove the !prefillConfig guard so the sync fires regardless of how the
dialog was opened. Add tests covering two-way sync between form fields
and the JSON editor.
@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trigger DAG form submits stale config when reusing a previous run's parameters

1 participant