Skip to content

Fix wizard crash on double-submit with async predicate#696

Merged
rzueger merged 1 commit intodevelopfrom
fix/wizard-double-submit-crash
Apr 11, 2026
Merged

Fix wizard crash on double-submit with async predicate#696
rzueger merged 1 commit intodevelopfrom
fix/wizard-double-submit-crash

Conversation

@rzueger
Copy link
Copy Markdown
Member

@rzueger rzueger commented Apr 11, 2026

Summary

  • submitPage in MovementWizard did not return the dialog predicate promise, so react-final-form considered the submission instantly complete and accepted re-submissions
  • Two rapid submits on page 4 (DepartureArrivalPage) launched two async aerodromeExists lookups that both resolved and dispatched nextPage, pushing wizard.page past the pages array bounds → TypeError: Cannot read properties of undefined (reading 'component')
  • Fix: return the promise so react-final-form blocks re-submission while the predicate is in flight

Fixes JAVASCRIPT-REACT-5C, JAVASCRIPT-REACT-50, JAVASCRIPT-REACT-5A, JAVASCRIPT-REACT-58, JAVASCRIPT-REACT-55, JAVASCRIPT-REACT-52

Test plan

  • Reproduced crash locally by adding 500ms delay to aerodromeExists and double-clicking Next on page 4
  • Verified fix: same double-click with delay no longer crashes
  • npm run typecheck passes
  • All 39 wizard tests pass

submitPage did not return the dialog predicate promise, so
react-final-form considered the submission instantly complete
and accepted re-submissions. Two rapid submits on page 4
(DepartureArrivalPage) launched two async aerodromeExists
lookups that both resolved and dispatched nextPage, pushing
wizard.page past the pages array bounds.

Returning the promise lets react-final-form block
re-submission while the predicate is in flight.

Fixes JAVASCRIPT-REACT-5C, JAVASCRIPT-REACT-50,
JAVASCRIPT-REACT-5A, JAVASCRIPT-REACT-58,
JAVASCRIPT-REACT-55, JAVASCRIPT-REACT-52
@rzueger rzueger merged commit cb01b37 into develop Apr 11, 2026
2 checks passed
@rzueger rzueger deleted the fix/wizard-double-submit-crash branch April 11, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant