Skip to content

01a0b3d5 - Keep /account/mail from mounting an empty email field - #1511

Merged
davidleomay merged 3 commits into
developfrom
fix/01a0b3d5-edit-mail-loading-prefill
Sep 18, 2026
Merged

davidleomay merged 3 commits into
developfrom
fix/01a0b3d5-edit-mail-loading-prefill

Conversation

@davidleomay

@davidleomay davidleomay commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

EN:
Keep /account/mail from mounting the email editor until the user context has finished loading, so the current address is prefilled instead of an empty field.
The full-stack e2e that asserts that prefilled value was failing when check2fa resolved before GET /user.
src/screens/edit-mail.screen.tsx coverage: statements 100%, branches 100%, functions 100%, lines 100%.

DE:
/account/mail öffnet den E-Mail-Editor erst, wenn der User-Kontext geladen ist, damit die aktuelle Adresse vorausgefüllt ist statt eines leeren Felds.
Der Full-Stack-e2e, der den vorausgefüllten Wert prüft, schlug fehl, wenn check2fa vor GET /user fertig war.
src/screens/edit-mail.screen.tsx Coverage: Statements 100 %, Branches 100 %, Functions 100 %, Lines 100 %.

Details

EditOverlay applies react-hook-form defaultValues only on first mount. After a full navigation to /account/mail, check2fa (hot after the just-completed 2FA) can finish before GET /user fills user.mail. The overlay then mounted with prefill=undefined and the field stayed empty.

This keeps the existing spinner while checking2fa || isUserLoading, so the overlay mounts only once the user payload is present. A loaded user without mail still sees the empty editor (add-mail). EditOverlay itself is unchanged. The matching full-stack test in e2e-stack/specs/account.spec.ts is unchanged; its toHaveValue assertion becomes stable.

Touched files must reach 100% statement/branch/function/line coverage (review gate). Measured on Node 20 with CI=true npm test -- --watchAll=false --coverage --collectCoverageFrom='src/screens/edit-mail.screen.tsx' --testPathPattern=edit-mail-return: 23 tests passed; src/screens/edit-mail.screen.tsx is 100/100/100/100.

Observed on the companion API develop-to-main Full-stack E2E: expected e2e+acct-mail-chg-3@dfx.swiss, received "". Frontend product code was the same as the previous green run.

EditOverlay applies defaultValues only on first mount. After a full
navigation to /account/mail, check2fa can resolve before GET /user,
so the email field stayed empty. Keep the existing spinner while
isUserLoading as well as checking2fa.
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

dfx pr guard

EN: Thanks for your contribution! This repository follows A38. A38 pass: author local-CI report accepted for this head.

DE: Danke für deinen Beitrag! In diesem Repository gilt A38. A38 pass: Autor-Local-CI-Report für diesen Head akzeptiert.

Details

@davidleomay

Copy link
Copy Markdown
Member Author

EN:
The A38 report below records the checks, results and durations.

DE:
Der A38-Bericht unten dokumentiert die Prüfungen, Ergebnisse und Laufzeiten.

Details
Check / Prüfung Duration / Laufzeit Result / Ergebnis Exit code
lint: Lint and Markdown format 74 s pass 0

Durations rounded up to whole seconds / Laufzeiten auf ganze Sekunden aufgerundet.

Original report / Originalbericht
{
  "head": "eb7815ab2507588391662a450d57db23c0268dd4",
  "private": false,
  "recorded_at": "2026-09-18T10:23:13Z",
  "repo": "DFXswiss/app",
  "required": [
    "lint"
  ],
  "runs": [
    {
      "command": "agent a38 job commands --config '{\"env\":{\"CI\":\"true\"},\"npm\":{\"canaries\":[\"react-app-rewired/package.json\",\"react-scripts/package.json\",\"typescript/lib/typescript.js\",\"prettier/package.json\"],\"node_major\":20},\"steps\":[[\"npm\",\"run\",\"lint\"],[\"npm\",\"run\",\"format:md:check\"]]}'",
      "duration_s": 73.07992487493902,
      "exit_code": 0,
      "id": "lint",
      "name": "Lint and Markdown format",
      "result": "pass",
      "timeout_s": 600.0
    }
  ],
  "schema": "dfx-local-ci/v1"
}

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

EN:
A write collaborator holds Ready; this pull request stays ready for review.

DE:
Ein Write-Collaborator hält Ready; dieser Pull Request bleibt bereit zum Review.

Details
{
  "base": "0c34dea9f15d8b891352723e86587ab590e84a87",
  "head": "94ef74ccdac0cf9ee15d0e4a0b17ee51d8125968",
  "phase": "applied",
  "pr": 1511,
  "reasons": [
    "CI not green: .github/workflows/codeql.yml (in_progress)",
    "CI not green: .github/workflows/pr-review-bot.yml (in_progress)",
    "CI not green: .github/workflows/pr.yml (in_progress)",
    "CI not green: dynamic/github-code-quality/codeql (in_progress)",
    "Required CI check not green: .github/workflows/pr.yml / Lint and Markdown format",
    "Required CI check not green: .github/workflows/pr.yml / Build and test",
    "Required CI check not green: .github/workflows/pr.yml / Full-stack E2E",
    "CI check not green: Build and test (in_progress)",
    "CI check not green: Lint and Markdown format (in_progress)",
    "CI check not green: Analyze (javascript-typescript) (in_progress)",
    "CI check not green: Analyze (actions) (in_progress)",
    "CI check not green: review (in_progress)"
  ],
  "repo": "DFXswiss/app",
  "state": "ready"
}

@github-actions
github-actions Bot marked this pull request as ready for review September 18, 2026 10:35
The overlay empty-prefill case must use a user object with no mail,
not an undefined user, so it matches the add-mail path.
@davidleomay

Copy link
Copy Markdown
Member Author

EN:
The A38 report below records the checks, results and durations.

DE:
Der A38-Bericht unten dokumentiert die Prüfungen, Ergebnisse und Laufzeiten.

Details
Check / Prüfung Duration / Laufzeit Result / Ergebnis Exit code
lint: Lint and Markdown format 11 s pass 0

Durations rounded up to whole seconds / Laufzeiten auf ganze Sekunden aufgerundet.

Original report / Originalbericht
{
  "head": "529792bb7b82f55696f37c3d87d017911ec1f90b",
  "private": false,
  "recorded_at": "2026-09-18T10:50:31Z",
  "repo": "DFXswiss/app",
  "required": [
    "lint"
  ],
  "runs": [
    {
      "command": "agent a38 job commands --config '{\"env\":{\"CI\":\"true\"},\"npm\":{\"canaries\":[\"react-app-rewired/package.json\",\"react-scripts/package.json\",\"typescript/lib/typescript.js\",\"prettier/package.json\"],\"node_major\":20},\"steps\":[[\"npm\",\"run\",\"lint\"],[\"npm\",\"run\",\"format:md:check\"]]}'",
      "duration_s": 10.991222749929875,
      "exit_code": 0,
      "id": "lint",
      "name": "Lint and Markdown format",
      "result": "pass",
      "timeout_s": 600.0
    }
  ],
  "schema": "dfx-local-ci/v1"
}

onSubmit swallowed a missing API message because error is falsy.
Match onVerify and surface Unknown error.
@davidleomay

Copy link
Copy Markdown
Member Author

EN:
The A38 report below records the checks, results and durations.

DE:
Der A38-Bericht unten dokumentiert die Prüfungen, Ergebnisse und Laufzeiten.

Details
Check / Prüfung Duration / Laufzeit Result / Ergebnis Exit code
lint: Lint and Markdown format 14 s pass 0

Durations rounded up to whole seconds / Laufzeiten auf ganze Sekunden aufgerundet.

Original report / Originalbericht
{
  "head": "94ef74ccdac0cf9ee15d0e4a0b17ee51d8125968",
  "private": false,
  "recorded_at": "2026-09-18T11:05:06Z",
  "repo": "DFXswiss/app",
  "required": [
    "lint"
  ],
  "runs": [
    {
      "command": "agent a38 job commands --config '{\"env\":{\"CI\":\"true\"},\"npm\":{\"canaries\":[\"react-app-rewired/package.json\",\"react-scripts/package.json\",\"typescript/lib/typescript.js\",\"prettier/package.json\"],\"node_major\":20},\"steps\":[[\"npm\",\"run\",\"lint\"],[\"npm\",\"run\",\"format:md:check\"]]}'",
      "duration_s": 13.32793691684492,
      "exit_code": 0,
      "id": "lint",
      "name": "Lint and Markdown format",
      "result": "pass",
      "timeout_s": 600.0
    }
  ],
  "schema": "dfx-local-ci/v1"
}

@davidleomay

Copy link
Copy Markdown
Member Author

EN:
Ready after 3 review passes.
Keep /account/mail from mounting an empty email editor until the user context has loaded.

DE:
Bereit nach 3 Review-Durchläufen.
/account/mail öffnet den leeren E-Mail-Editor erst, wenn der User-Kontext geladen ist.

Details

Review passes:

  1. Coverage numbers missing from the PR body (fixed in the description). Add-mail test used mockUser = undefined (fixed to mockUser = {}).
  2. onSubmit swallowed a missing API message (fixed: Unknown error, same as onVerify). Playwright baseline for /account/mail rejected: the settled editor is unchanged; the spinner already existed for checking2fa; no new visual variant. Extra mockUser = undefined test rejected: measured coverage of the touched screen is already 100/100/100/100.
  3. Four lanes STATUS: complete, 0 findings at HEAD 94ef74cc.

A38: lint + Markdown format pass on this head (author report posted). GitHub PR CI on the previous head was green; this head is a one-line product fallback plus the matching test.

This repository is an A38 adopter: the author leaves the PR as draft; Ready is the guard.

@davidleomay
davidleomay merged commit 4a884fe into develop Sep 18, 2026
10 checks passed
@davidleomay
davidleomay deleted the fix/01a0b3d5-edit-mail-loading-prefill branch September 18, 2026 11:54
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.

2 participants