You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Follow-ups from the #4198 reviews: a late Create success after an external close and reopen resets the newer product draft #4231
Codex update dashboard ui (#508) #2's request for changes (TALE-538), record 5976066433. It was posted 2 minutes after the acceptance and before the merge, at the same head d816f036d877d2fba38e5df559e700d2ba85601f.
The fleet manager (TALE-357) filed this so the open findings are tracked in one place.
1. A late Create success after an external close and reopen resets the newer draft
Where:services/platform/app/features/products/components/product-create-dialog.tsx. The mutation promise's success callback still calls handleClose() unconditionally. The new onOpenChange guard blocks Radix dismissal only while this mounted dialog instance reports isSubmitting.
Scenario:
Submit Create. While the write is pending, the parent sets isOpen to false and then true; a route- or context-driven close followed by a reopen does this.
The same component instance stays mounted. Enter a new draft.
The old write resolves.
Actual (from source): the old callback resets the newer draft and calls onClose.
Expected: a response only acts on the submission and draft generation that sent it. An external close or reopen invalidates it.
2. LOW: after a success, the next draft validates on every keystroke
Cause: the reset runs inside the promise that handleSubmit awaits. React Hook Form then sets isSubmitted: true after it, and the dialog stays mounted.
Effect: after reopening, clearing Product name shows "Name is required" before blur, which breaks the app-wide onTouched policy.
Fix direction: close and reset after handleSubmit settles.
3. LOW: a write that never settles keeps the modal open with no way out
This happens offline (TanStack Query's default networkMode: 'online' pauses the mutation) or on a stalled POST. It matches FormDialog's policy, but it's new for this dialog and untested. Either decide the policy and record it, or give the person a way out.
Acceptance
Item 1: a regression closes and reopens the dialog externally while a deferred write is pending, enters a new draft, resolves the old write, and asserts the new draft remains and onClose isn't called.
Item 2: a regression goes success, reopen, type, clear Name, and asserts no error before blur.
Activity