Repository navigation
fix(platform): preserve team roster drafts on refresh - #4233
Conversation
There was a problem hiding this comment.
Independent review — PR #4233
Verdict: REQUEST CHANGES at 85d0e181510d51448f6377b443de2642044dbebf.
Reviewer: agent 579ebc6d-a30d-43a6-b3fb-a340b6a22eae, run d9a89030-3636-461f-aa00-708eb56fd89b (TALE-559), distinct from implementation agent 31b27429-fe64-4694-86de-4169cb2067f3, run 58e3fa71-4ede-4f68-b079-be628db1140e (TALE-130).
Read TALE-130 and issue #3584 in full. Confirmed this full PR head at the start; reconfirm before posting.
Findings
-
P2 — A refresh with the same user-ID roster still silently discards the draft (
services/platform/app/features/settings/teams/components/team-edit-dialog.tsx:101). The new early return requires bothhasLocalChangesandrosterChanged. When query rows change but the set of user IDs does not, it falls through tosetSelectedMemberIds(memberIds)and replaces the baseline. Open with A, select B, then deliver a new membership row for A (e.g. another session removes/re-adds A; metadata/order changes can also refresh rows). Actual dialog + actual React Hook Form + actual FormDialog jsdom probe at this head observes{"roster":"user-a","saveDisabled":true,"conflict":null}. Before refresh, A+B was selected and Save was enabled. The regression assertion fails at A+B retention. Preserve every dirty draft on refresh; only set the conflict flag if the remote roster actually changed. Add unchanged-user-ID refresh coverage, retaining dirty/Save state, alongside the changed-roster test. -
P3 — Finish regional spelling and French address for the new conflict text (
services/platform/messages/de.yml:5796,services/platform/messages/fr.yml:5879). EN/DE/FR all contain the key, but German introducesSchließewithout a corresponding sparsede-CHoverride. The documented fallback is de-CH → de → en, with no spelling conversion, so Swiss readers getß; the repo locale contract requiresss. Add a Swiss override usingSchliesse. FrenchFermez ... rouvrez-lauses formal/plural address instead of the required informaltu; useFerme ... rouvre-la. These are new-string contract violations, not missing full-catalog keys.
Observed proof
- Targeted original
team-edit-dialog.test.tsx: 9/9 passed at the reviewed head, including the new A → select B → A+C conflict test and the successful name-save control. - Negative control: same submitted regression, with only
team-edit-dialog.tsxrestored to its pre-fix parent version: fails as expected, missing conflict alert; rendered Save is disabled. Head source was restored after the run. - Independent lightweight jsdom state/effect probe: changed-roster draft/conflict and clean-dialog-follow-server cases pass; unchanged-roster draft preservation fails (2 passed, 1 failed). Form/query/checklist infrastructure is mocked in this supplementary probe.
- Stronger unchanged-roster probe appended temporarily to the PR's own test harness: fails as expected at head; actual dialog, form state and FormDialog execute; query delivery and checklist are the existing mocked seams. Snapshot above proves silent loss and Save disabling. The PR test source was restored afterward.
- Scoped type-aware oxlint: exit 0 on the two changed TSX files.
- Scoped TypeScript compiler diagnostics: 0 on those two roots, including the real UI setup for jest-dom matcher augmentation, bounded to a 2 GiB Node heap. Imported dependency graph loaded; no whole-workspace typecheck was run.
- oxfmt check: pass (formatter matched two TSX files; YAML paths were supplied but not checked by this formatter).
git diff --check: pass after restoring source/test files.- New alert has
role="alert"; existing labelled input/checklist and shared disabled submit semantics remain. No new interactive control was introduced. Visual/contrast/focus behavior was not exercised in a browser.
Proof boundaries
The first worktree test attempt was blocked by Vite denying an external dependency font path. A review-only config allowed the shared dependency directory; targeted tests then executed successfully. The author's reported Zod collection blocker did not reproduce here. A first scoped typecheck omitted UI test setup and reported missing jest-dom matcher types; including the repository's setup resolved those harness diagnostics.
No browser, E2E, two-session end-to-end run, stack, database, containers, full suite, workspace tsc or CI rerun/cancellation. No merge, push or card move. Disk first: 209 GiB available; later: 203 GiB, both above 20 GiB. CI status is recorded passively, not treated as functional proof. Repair stays with the implementation owner; re-review a new exact head after the dirty-draft and locale fixes.
Final exact-head targeted rerun: team-edit-dialog.test.tsx, team-dialogs.lapsed-session.test.tsx, and team-row-actions.test.tsx: 38/38 tests passed across 3 files, one worker. This does not cover the failing unchanged-user-ID refresh sequence found above.
GitHub principal is shared with the PR author; GitHub refuses a formal REQUEST_CHANGES review. This COMMENT review records the independent REQUEST CHANGES verdict for the exact commit; it is not a native task decision or merge approval.
yannickmonney
left a comment
There was a problem hiding this comment.
Independent re-review verdict: REQUEST CHANGES (recorded as a comment because GitHub does not allow this shared principal to submit a native request-changes review).
Exact head checked immediately before posting: 8a6d0faa15b67fe17a5d0ef31532a3fb2dca1ce1.
- The repair preserves the dirty
user-a,user-bselection and keeps Save disabled when the query refreshes. - However, the repaired effect now raises
hasRemoteMemberConflictfor any refresh while the roster draft is dirty. For a refresh whose user-ID set is unchanged (user-a→ refreshed row foruser-a), this reports a remote membership conflict even though the remote roster did not change. The prior review contract requires preserving the draft while setting the conflict only when the remote roster actually changes. The new regression currently asserts the incorrect conflict behavior rather than distinguishing this case. - The changed-roster A+B → A+C path, localized de-CH
Schliesse, informal FrenchFerme ... rouvre-la, and retained disabled successful-save control are present. The repair interdiff is limited to the dialog test, dialog, de-CH, and French locale files.
Verification:
bunx oxlint --type-awareon the two changed TSX files: pass.bunx oxfmt --checkon the two changed TSX files: pass.git diff --checkfor the repair interdiff: pass.- Targeted
team-edit-dialog.test.tsxundervitest.ui.config.ts: unrun; collection stops before tests with the existing workspace runtime errorTypeError: undefined is not an object (evaluating 'z.number')inpackages/shared/src/schemas/epoch-ms.ts. - No browser, E2E, full suite, CI rerun/cancellation, merge, or push performed.
The roster guard read every refresh of a changed draft as another session's edit, the refresh a dialog's own writes cause included. After a saved roster change the dialog opened again with the conflict alert and a disabled Save, and a refused write left the alert beside a toast that says the list was refreshed. The dialog's own save, and the refresh after a refused write, replace the draft; changing the roster again guards it once more, and closing by any path ends it. SET-B38 covers two live sessions.
The Edit team dialog keeps a changed roster when another session changes the team's members, says so and leaves Save changes off until the dialog is opened again. The teams guide now says it in English, German and French.
8a6d0fa to
a3bfd7a
Compare
SET-B38 is taken by the Connected agents box that main gained meanwhile; the register row follows the box.
What changed
Verification
bunx oxlint --type-aware services/platform/app/features/settings/teams/components/team-edit-dialog.tsx services/platform/app/features/settings/teams/components/team-edit-dialog.test.tsxbunx oxfmt --check services/platform/app/features/settings/teams/components/team-edit-dialog.tsx services/platform/app/features/settings/teams/components/team-edit-dialog.test.tsxgit diff --checkvitest.ui.config.ts; collection is blocked by the existing workspace Zod runtime error (z.numberundefined inpackages/shared/src/schemas/epoch-ms.ts).Closes #3584