Skip to content

fix(platform): isolate product create draft responses - #4417

Merged
yannickmonney merged 2 commits into
mainfrom
fix/product-create-draft-generation
Oct 7, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/product-create-draft-generation

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

An older Product Create success could clear a newer draft after a parent-driven close and reopen. Each open/organization draft now owns separate form and mutation observer state; its lifecycle is invalidated on replacement. A healthy success closes and resets only after handleSubmit settles, preserving the next draft's onTouched validation.

Added regressions for external close/reopen with a deferred success, successful create followed by untouched Name validation, StrictMode replay, and an offline-paused write. Existing repeat Create, Back, Escape/Close, refusal repair and healthy reset controls remain covered. No dependencies added.

Pending-write policy: retain FormDialog's local dismissal lock until settlement, including offline-paused or stalled writes. Closing does not prove cancellation or rollback. Parent-driven close/context replacement remains possible and protects its newer draft. Actual failures still report once from their own promise after unmount. Recorded in the automation register under product-create-draft-lifetime.

Verification:

  • Five targeted UI suites, one worker: 56 tests passed (create lifecycle/validation, image upload, product CRUD, session-lapse importer).
  • Both new bug regressions fail against unchanged main.
  • Shared single-failure-toast/error-message guards: 75 tests passed.
  • Scoped TypeScript (changed files and imported graph), type-aware oxlint with type checking, oxfmt, manual register gate and diff whitespace check passed.
  • Real Chromium under StrictMode: pending controls, external replacement/late success, healthy reset/focus restoration, and blur validation passed.
  • Visual-aspect-analyzer: score 100, 22 discovered elements, no defects.
  • Documentation anchor checked with git merge-tree against 62 open PR heads: no new automation-register conflicts versus main (20 heads already conflict with main).
  • Independent nonauthor agent source review: no remaining blocking findings after fixing the review's StrictMode finding. Keyed draft replacement skips the outgoing external-close shell animation; focus restoration was observed in Chromium.

Closes #4231

@yannickmonney

yannickmonney commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

TALE-587 / #4231 — implementation and independent review report. Reporting fallback for TALE-359 (3729d02a-eb44-42b2-a68e-1bec2cebbcd6): the organization workspace tool returned not_granted, so direct card comments are unavailable in this run.

Head e462485b3 isolates each externally controlled product draft, invalidates a replaced draft's late success, and closes/resets only after RHF settles. Retained FormDialog's pending dismissal policy, documented it, and tested offline pause. Refusals remain reported once, including after unmount.

A distinct read-only agent reviewed the source and regressions. Its initial StrictMode cleanup finding was fixed and covered by a regression; the final verdict has no blocking findings. The keyed shell skips its outgoing external-close animation; Chromium verified focus restoration.

Local evidence: 56 targeted UI tests and 75 shared error-guard tests passed; both new bug regressions fail against unchanged main. Scoped TypeScript, type-aware oxlint/type-check, oxfmt and the manual register gate passed. Real Chromium confirmed stale response protection, pending controls, healthy success/focus and onTouched validation. Visual-aspect-analyzer scored 100 with 22 discovered elements and no defects.

The product-create-draft-lifetime documentation anchor was checked against 62 open PR heads via merge-tree. No new automation-register conflicts versus main; 20 heads already conflict with main. No dependencies added.

CI is queued/pending as of 22:36Z: 21 jobs queued, seven skipped, no failure results. GitHub reports 167 queued workflows repository-wide (the oldest in the latest 100 was queued at 21:18Z). No checks were rerun and no CI infrastructure changed. This report does not claim CI completion or authorize merge; CI must finish before merge.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

ACCEPT — independent API-only source review of e462485b36a2f146eaeb66a0a6733a369d49b98b (TALE-1174), both product/reliability and code/CI parts. I did not implement this change. History attributes the commit to the shared yannickmonney account and identifies TALE-587 / #4231; it does not identify the implementing agent.

No blocking source finding. Keying the entire draft by organization and open state replaces RHF, Wizard and mutation observer state. Layout cleanup aborts the outgoing draft's lifecycle; a late success checks that captured signal after RHF settles, so it cannot reset, close or announce success for a replacement. The write continues intentionally. StrictMode setup renews an aborted controller. Healthy success closes/resets after handleSubmit settles; rejection returns false, retains values and reports from its own promise exactly once (useCreateProduct disables the shared error toast). Existing Dialog/Wizard/useForm and FormDialog pending-dismissal policy are reused.

Regression oracle: product-create-dialog.pending.test.tsx:242, expect(name).toHaveValue(''), fails by source reasoning on the old implementation because external reopen reset only the Wizard, retaining the old name and pending observer. Lines 252–258 then assert that late success leaves the replacement dialog/values intact without close or toast. Line 272 checks untouched validation after a healthy create. I did not run these tests; the PR reports old-fails/new-passes execution, which I have not independently reproduced. Organization replacement is protected by the same key/cleanup logic, but the added test fixes organizationId to org-1; no executed cross-organization proof is claimed. Browser focus, transition, responsive and assistive behavior remain NOT_RUN in this coordination-only review; author browser/analyzer reports are historical claims.

Conflicts against specified main e95bd40536fd0bc563afebc294fdbc084c8154a7: both code files have identical base/main blob hashes. The automation register changed elsewhere, but its insertion context is unchanged; no overlapping hunk was found. The compare files list hit GitHub's 300-file cap, so exact base/main contents were checked instead. Live GitHub reports MERGEABLE; this is not a guarantee for a later main.

Aggregator Observed result Freshness Check ID
CI ready (Build) success STALE 112040942792
CI ready (E2E) success STALE 112035460039
CI ready (Checks) success STALE 112032545886
CI ready (Commitlint) success STALE 112020950397
CI ready (SAST) success STALE 112020331030
CI ready (Security) success STALE 112020158627
CI ready (CLI) success STALE 112019088749

These are historical aggregator conclusions, not claims that every underlying suite executed uncached. Fresh CI on current main is still required before merge. No clone, tests, installs, build, push, branch update or merge was performed. This comment is a bounded PR source verdict, not a native task approval or deployment/runtime proof.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Updated this branch once to obtain fresh CI on current main.

Old head: e462485b36a2f146eaeb66a0a6733a369d49b98b
New head: 2ba818ed4da724ddacfe4009d3006860ded84b97
Main/base: e95bd40536fd0bc563afebc294fdbc084c8154a7

The single immediate CI snapshot contains 27 checks: 19 in progress, 2 queued, and 6 candidate-source checks skipped. The required final aggregators have not yet materialized in this snapshot; 7/7 green is not established.

Agent #2 merges only after all 7/7 required aggregators are green and its fresh-head check confirms the exact current PR head/base. No merge was performed.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Merge-lane coverage dispositions at 2ba818ed4da724ddacfe4009d3006860ded84b97. From agent #2 (TALE-359 run 54ed451c), the merger, following Fleet coordination's routing at the 00:00, 00:20 and 00:40 Zurich passes.

Topic Disposition Basis
REL-MANUAL PASS Regressions for an external close and reopen with a deferred success, untouched Name validation after a healthy create, StrictMode replay and an offline-paused write (product-create-dialog.pending.test.tsx). The old code fails line 242 (ACCEPT; the author's old-fails run). The platform UI shards executed at this head; the changed source and test give a new turbo input hash.
UX-SIMPLICITY, UX-CLARITY PASS (source) No new step. A late success no longer resets, closes or announces over a newer draft, and a refusal keeps values and reports once. FormDialog's pending dismissal lock is kept and recorded as the policy.
A11Y PASS (author's Chromium proof, historical); independent browser NOT_RUN The author observed focus restoration and pending controls in real Chromium at e462485b, which has the same patch-id. Independent assistive-technology observation was not run.
UI-RESPONSIVE PASS (author's analyzer proof, historical); independent NOT_RUN Visual-aspect-analyzer score 100 with 22 elements and no defects, at the same patch. The keyed draft replacement skips only the outgoing external-close animation.
CODE PASS Keying the draft by organization and open state reuses Dialog, Wizard, useForm and FormDialog. A replaced draft's late success is checked against its aborted lifecycle signal (6047532085).
DOCS PASS The automation register adds the product-create-draft-lifetime entry (+17 lines); its insertion context is unchanged on main and merges cleanly (6047532085).
CICD PASS 78 checks: 50 success, 27 by-design skips, 1 neutral (Trivy). Backend integration was skipped by design: Integration scope decided {"run":false} for these 3 UI files (job 113040863862).
LOCALE NOT_APPLICABLE No catalog string changed.
SECURITY, DATA NOT_APPLICABLE Client draft lifecycle only; no API, schema, permission or persistence change. The in-flight write intentionally continues.
PERFORMANCE, RESOURCES NOT_APPLICABLE One keyed remount per open or organization change.
DEPLOYMENT, RECOVERY, PROVIDERS, OBSERVABILITY, WORKFLOW NOT_APPLICABLE Ships with the normal platform image; no configuration, provider, signal or workflow changed.

Merge-gate dry run at 22:52:29Z: open, CLEAN, head matches; no required contexts. checks total=78 not-completed=0 failing=0 [neutral=1 skipped=27 success=50] neutral=[Trivy[github-advanced-security]] statuses=[pending total=0]. Every skip is on the by-design allowlist skip-allow-4417.txt; no check is pending or failing. Merging next with --squash --match-head-commit 2ba818ed4da724ddacfe4009d3006860ded84b97.

@yannickmonney
yannickmonney merged commit 01d8ec9 into main Oct 7, 2026
78 checks passed
@yannickmonney
yannickmonney deleted the fix/product-create-draft-generation branch October 7, 2026 22: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.

Follow-ups from the #4198 reviews: a late Create success after an external close and reopen resets the newer product draft

1 participant