Skip to content

fix(platform): recover failed erasure subject directory reads - #4325

Merged
yannickmonney merged 1 commit into
mainfrom
fix/data-subject-picker-read-error
Oct 12, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/data-subject-picker-read-error

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

A failed erasure-subject directory read shows the existing localized recovery state. Filing requires a successful response containing the selected member, enforced by both the button and the submit handler. Initial loading stays masked and a successful empty response keeps its normal empty message.

The older failed-refresh findings are addressed: an open picker retains its loaded options and returns Escape focus to Subject; a failed empty refresh uses failure copy. Failed or stale reads keep submission blocked, including a direct form submit. The current-main rebase retains both the DSAR coverage row and main's Legal Hold Matters row. The dialog and regression files are byte-for-byte unchanged from the published 85b00c5 payload.

Validation after rebasing onto 1819124: all 12 dialog tests pass, including the two requested failed-refresh/Escape cases, stale-submit gating, recovery and accessibility checks. Full platform types, scoped type-aware lint, formatting, manual-reference lint, conflict-marker guard and diff check pass. React Doctor reports 93 with no diagnostics. These are component tests with synthetic query replies; full native merge-queue validation remains required.

Closes #3857
Closes #3858

@yannickmonney

Copy link
Copy Markdown
Contributor Author

Independent review (TALE-706): REQUEST CHANGES at a3579c805ebc443759e2ad9c3177594c75ee7c54

Context

Verdict

Request changes. There is one blocking finding (B1). Every other criterion in the brief is met.

Criteria

Criterion Result Evidence
Failed read: localized alert and a focus-safe Retry, never "No matching members." Met for a read that never answered. Not met for a failed refresh while the picker is open (B1). Probe P1 uses the real hook: 4 attempts against a 503, then the alert. Retry keeps focus with aria-busy through a held retry, recovery hands focus to Subject, and the member can be picked. B1 is below.
Real empty results keep their copy Met Probe P2 (real hook) and the PR's own test
Submit gated while the subject list is unknown, in the UI and the handler Met in the code. The PR's tests pin only the UI gate (N1). P5: a stale failure disables File request and Enter files nothing. P6: a direct submit on the form files nothing (0 POSTs).
Initial loading mask Met P3: role=status "Loading content", the trigger is disabled, and there is no empty copy
Closes both duplicates Met Closes #3857 and Closes #3858. GraphQL closingIssuesReferences lists both.
EN/DE/FR Met; one EN style nit (N2) userPickerFailed is at the same path in all three catalogs. DE and FR are idiomatic.
The regression fails on main Met The PR suite on main's sources (the dialog and the three catalogs from b77a452ef) gives 3 failed and 5 passed. At the head it gives 8/8. My probe on main fails 6 of 7; only P2, the empty-directory control, passes.

B1 (blocking): a failed refresh lists the open picker as "No matching members." and drops focus on Escape

Path. The Subject picker is open on a loaded directory, and the directory is re-read. The re-read can come from a member backend hint, since the key is backendKey(org, MEMBER_HINT_ENTITY, 'picker'), or from any invalidation. The re-read then fails: a 503, which retryAdaptedRead retries and which then settles in error.

At this head:

  • options={membersUnavailable ? [] : memberOptions} empties the list under the open popover.
  • The listbox now reads "No matching members." (0 options), directly under the "Unable to load members." alert. This is probe P4: listbox=open options=0 emptyCopy=true.
  • disabled also flips on the trigger while its popover is open. Escape then returns focus to a disabled button, and focus lands on body (P4b).

On main, the same path keeps listing the last answer (react-query keeps data), with no empty copy. A P4 variant on main's sources, which waits for the 5 reads instead of the alert, shows options=1 emptyCopy=false. So this path is a regression this PR introduces. It breaks the contract's "never 'No matching members.'" for a failed read, and it breaks focus safety.

Repair sketch (b1-open-picker-sketch.diff, 3 lines; submit stays gated by the unchanged hasAvailableSubject):

-            options={membersUnavailable ? [] : memberOptions}
-            disabled={!members.isSuccess || membersUnavailable}
-            emptyText={t(
-              'dataSubjectRequests.dialogs.fileRequest.userPickerEmpty',
-            )}
+            options={memberOptions}
+            disabled={members.data === undefined}
+            emptyText={
+              membersUnavailable
+                ? t('dataSubjectRequests.dialogs.fileRequest.userPickerFailed')
+                : t('dataSubjectRequests.dialogs.fileRequest.userPickerEmpty')
+            }

With the sketch, the PR suite and my probe pass 15/15:

  • P4: the open list keeps the last answer under the alert.
  • P4b: Escape returns focus to Subject.
  • P1–P3, P5 and P6 stay green.
  • Selection: a stale selection keeps its label, but File request stays disabled until a successful re-read that still contains the member.

To close B1, the fix has to pass P4 and P4b, in my probe or in an equivalent test in the PR.

Non-blocking

  • N1. The handler gate is not pinned. Removing || !hasAvailableSubject from onSubmit leaves the PR suite at 8/8. The Enter press in the PR's test reaches only the disabled submit button, never the handler. My P6 (fireEvent.submit(form) during a stale failure) fails on that mutant and passes at the head. Please add a test like it.
  • N2. EN copy. "Unable to load members." is the only "Unable to load" string in en.yml, against 46 "Couldn't load …" strings (for example "Couldn't load your chats."). Consider "Couldn't load members." DE and FR follow their catalogs.
  • N3. Shared helper. membersUnavailable re-derives readStateOf (app/lib/backend/read-state.ts, unavailable || stale) by hand. The truth table is the same for this read, but the helper exists for exactly this case, and the sibling fixes (fix(platform): show a failed passkey list read with a retry #4300, fix(platform): recover automation run detail read failures #4288) use it. Its failureCount also works as the failureKey.

How I verified

  • Runner: installed Node v24.21.0 and vitest 4.1.11, jsdom --project client --maxWorkers=1 --testTimeout=60000, on a detached worktree at the head.
  • Probe: file-request-dialog.review-probe.test.tsx, untracked and not part of the PR. It drives the real useOrgMembersForErasurePicker → useBackendQuery → react-query useQuery → adapter row → backendFetch path, plus the real erasure mutation, against syntheticBackend() with retryDelay: 0.
  • Results:
    • PR suite at the head: 8/8.
    • PR suite on main's sources: 3 failed and 5 passed.
    • Probe at the head: 5/7 (P4 and P4b fail).
    • Probe on main's sources: 1/7.
    • Handler mutant: PR suite 8/8, probe P6 fails.
    • Sketch: 15/15.
  • Files: the probe, its observation logs, the mutant and sketch logs, and the sketch diff are attached to TALE-706.

Not run:

  • a real browser (B1 is jsdom-only evidence);
  • a live backend or PostgreSQL;
  • a real SSE member hint;
  • a screen reader;
  • lint or type-check of the sketch;
  • full suites.

CI: at 16:19Z, 16 checks were pending and 5 were skipping on this head. I did not rerun or cancel anything.

I made no merge, push, CI action or card move.

@yannickmonney
yannickmonney force-pushed the fix/data-subject-picker-read-error branch from a3579c8 to 242f857 Compare October 9, 2026 02:19
@yannickmonney
yannickmonney disabled auto-merge October 9, 2026 02:56
@yannickmonney
yannickmonney force-pushed the fix/data-subject-picker-read-error branch from 242f857 to b312837 Compare October 9, 2026 12:30
@yannickmonney
yannickmonney force-pushed the fix/data-subject-picker-read-error branch 2 times, most recently from 370c97a to 85b00c5 Compare October 9, 2026 15:02
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 9, 2026
@yannickmonney
yannickmonney force-pushed the fix/data-subject-picker-read-error branch from 85b00c5 to a577e95 Compare October 11, 2026 23:09
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 11, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 12, 2026
@yannickmonney
yannickmonney added this pull request to the merge queue Oct 12, 2026
Merged via the queue into main with commit 5a4b4da Oct 12, 2026
@yannickmonney
yannickmonney deleted the fix/data-subject-picker-read-error branch October 12, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant