diff --git a/aidlc-docs/features/identity-email-notifications/aidlc-state.md b/aidlc-docs/features/identity-email-notifications/aidlc-state.md index 1cf84cb..175072e 100644 --- a/aidlc-docs/features/identity-email-notifications/aidlc-state.md +++ b/aidlc-docs/features/identity-email-notifications/aidlc-state.md @@ -5,7 +5,7 @@ - **Feature Slug**: identity-email-notifications - **Project Type**: Brownfield - **Start Date**: 2026-11-08 -- **Current Stage**: CONSTRUCTION - U1 and U2 code generated and tested; requirements and design approved by Bryan (relayed), D1 and D2 decided +- **Current Stage**: OPERATIONS - code complete and on ASF test and SlpSoftware test; waiting for Bryan's testing of run 635 (65ee73f) on both test environments before any merge - **Branch**: feature/identity-email-notifications (branched from feature/andreaslop-site-hosting at e9feb37; own branch, not merged anywhere) - **Request Type**: Feature (Bryan chose real e-mail over a workaround button; relayed by session "CMS & API") @@ -58,3 +58,13 @@ - [x] Monitoring Setup - Q4 B (config-related mail failures at Error), Q5 A; log-level change built and tested; operations/monitoring/* - [x] Production Readiness - checklist written; verdict: not yet (real test mails, Sentry rule, Bryan's approval); operations/production-readiness-checklist.md - Open for a later feature: ASF production on IIS (hosting assumptions listed in operations/deployment/deployment-plan.md) + +### Late fixes after the first test deploys (2026-11-09/10, all on the branch) +- [x] Mail layout: SLP red, dark-mode button, logo swap (dark variant) and white badge, site name next to the logo, dark card that stands out (page `#0a0e14`, card `#273244`, 1px border), inline card border `#d1d5db` and Outlook `data-ogsb`/`data-ogsc` rules, 16 px gutter around the card. Light mode unchanged. Real behaviour in the Gmail app (Gmail and non-Gmail account) and Outlook still to be confirmed by a real test mail. +- [x] Master/slave status: the slave's fail-open grace period now runs from the master's last contact (poll, push, registration), not from the last successful poll (a pushed "not available" fell open at the next failed poll). Poll failures log `master_poll_failed reason=... detail=...` (first stack frame, `url_absolute`, `scheme`, `key_present`; never URL, key or message). +- [x] Master URL: the shipped `appsettings.json` holds a placeholder; the hourly/start-up integrity check (no request) used it and re-registered slaves with it, so their polls failed. Now `MasterUrlRules` (absolute http(s), no credentials/query/fragment): the master skips background checks on an unusable value (warning), a slave refuses one (400 `invalid_master_url`), the poller reports `invalid_master_url`. **The variable is `MasterModule__MasterUrl`** (section `MasterModule`); an earlier note said `Master__MasterUrl`, which is never bound - corrected in `operations/deployment/deployment-plan.md`. +- [x] Availability gate: an expired token on a blocked route answers 401 (not 503) so the app refreshes its session and passes as admin; missing, forged, wrong-key and non-admin tokens stay 503. +- [x] Session at start-up: a refresh without a verdict (429/5xx/network) ends in an "unreachable" retry screen, not as a guest; Retry-After is sent (refresh 15 s) and honoured (max 15 s per wait). +- [x] Logout hang: with the CMS switched off (own setting or master) signing out froze the app. Cause: the AppLayout effect "NotAvailable -> go to /dashboard" also ran for a guest, which the authenticated route sent back to /login - an endless navigation loop. Fixed (only for an authenticated user); test `LogoutWhileCmsOff.test.tsx` never finished on the old code. +- [ ] Not built, decisions with Bryan: own rate-limit policy for `Setup/status`, judge the admin token only when a request is really blocked, a visible error state with "Reload" and a fetch timeout (see `../contact-feature/contact-feature-prereqs.md`, local commit 3f060a8, not pushed). +- Merge to master: **not approved**. Bryan wants to test both test environments first (including run 635 / 65ee73f); the CMS session may merge later on his explicit go (Gitea PR with merge commit and green CI unless he chooses otherwise). diff --git a/aidlc-docs/features/identity-email-notifications/audit.md b/aidlc-docs/features/identity-email-notifications/audit.md index c55efad..0226c3f 100644 --- a/aidlc-docs/features/identity-email-notifications/audit.md +++ b/aidlc-docs/features/identity-email-notifications/audit.md @@ -117,3 +117,18 @@ **Context**: Operations phase complete for the e-mail feature (docs and code); production readiness verdict: not yet. --- + +--- + +## Test findings and fixes after the first deploys + +**Timestamp**: 2026-11-10T00:30:00Z + +**User Input**: "(Relayed by 'CMS & API', Bryan's test results and decisions, runs 632-635) ASF status falls back after ~9 s; owner logged out while ASF is not available; mail card invisible in dark mode; ASF poll failing with InvalidOperationException; app keeps loading after logout with the CMS switched off; merge to master not yet - test first. Update aidlc-state.md, audit.md and the production readiness checklist with what happened and turned out." + +**AI Response**: "Found and fixed (separate commits on the branch, see aidlc-state.md 'Late fixes'): fail-open grace period measured from the last contact of the master; unusable master URL (shipped placeholder re-registered into slaves by the integrity check) with validation on both sides and safe poll diagnostics; expired token answered 401 by the gate; start-up refresh without a verdict ends in a retry screen with Retry-After; mail card (title next to logo, border, Outlook rules, gutter); logout hang (AppLayout redirect effect ran for a guest, endless navigation loop, reproduced by a test that never finished before the fix). Corrected a wrong variable name in my release note: MasterModule__MasterUrl, not Master__MasterUrl (it was never bound, which is why the master kept the placeholder). Not proven: why clearing site data cured the hang on the phone; whether the Gmail app/Outlook now show the dark card (needs a real test mail). Proposals left to Bryan: Setup/status rate-limit policy, admin-token evaluation only on a real block, error state with Reload, fetch timeout, and the availability-gate change for the contact feature (written down in features/contact-feature/contact-feature-prereqs.md)." + +**Context**: Operations/test feedback loop; merge to master explicitly not approved until Bryan has tested both test environments including run 635 (65ee73f). + +--- + diff --git a/aidlc-docs/features/identity-email-notifications/operations/production-readiness-checklist.md b/aidlc-docs/features/identity-email-notifications/operations/production-readiness-checklist.md index 94b7bfb..3ec4e68 100644 --- a/aidlc-docs/features/identity-email-notifications/operations/production-readiness-checklist.md +++ b/aidlc-docs/features/identity-email-notifications/operations/production-readiness-checklist.md @@ -11,6 +11,9 @@ Scope: ASF test and SlpSoftware test now; SlpSoftware production after Bryan's a - **Status**: Configured in code (log levels), alert rule documented and still to be created in Sentry by a person - **Approach**: journal plus Sentry Error events for configuration-related mail failures; no threshold, no dashboard (Q4 B) +## Master host setting (added 2026-11-10) +- **`MasterModule__MasterUrl` is required on every master host** (SlpSoftware test and production): https, no path. The shipped `appsettings.json` only holds a placeholder. Without a valid value the master logs `MasterModule:MasterUrl is not an absolute http(s) address` and skips its background checks (before the fix it overwrote slaves with the placeholder and their polls failed). The variable is NOT `Master__MasterUrl`. Production readiness item: set and verify it, then restart the master and watch the slaves' `master_poll_recovered`. + ## Additional Readiness Items - **Deliverability (Q6 A)**, before SlpSoftware production: send test mails to a Gmail and an Outlook mailbox and check in "show original" that SPF, DKIM and DMARC pass and are ALIGNED with the From domain (the From domain, the SPF-authorised server and the DKIM signing domain must match); DMARC stays `p=none` for now. Facts at 2026-11-08: both `slpsoftware.nl` and `andreaslop.nl` publish `v=spf1 a mx include:smtp.spf.ziggo.nl ~all`, a `dkim._domainkey` record and DMARC `p=none`. For ASF the sender `no-reply@andreaslop.nl` through `mail.andreaslop.nl` is expected to align (the host is the domain's own `a`/`mx`); to be proven by the real test mail. - **Real test mails (Q8 A)**: one per site on test (invitation, new link by mail, password reset, a notice) to an address of Bryan; the approval of this feature depends on them. @@ -29,8 +32,11 @@ Scope: ASF test and SlpSoftware test now; SlpSoftware production after Bryan's a 1. **ASF production on IIS** (decided 2026-11-09): not worked out here. The Pi-specific assumptions (systemd unit, `shared/env`, journalctl, scp deploy, reverse-proxy Pi) and what changes on IIS are listed in `deployment/deployment-plan.md`; a later ASF-production feature must settle them (environment variables and secrets, restart, logs, deploy path, hosting model, database and mail-server reachability). 2. Sentry alert rule to be created (monitoring setup). 3. Real test mails on ASF test and SlpSoftware test. -4. Merge to master / SlpSoftware production: not approved yet (the branch is already on ASF test and SlpSoftware test). +4. Merge to master / SlpSoftware production: not approved yet (the branch is already on ASF test and SlpSoftware test). Bryan first tests both test environments including run 635 (65ee73f: logout hang, mail card gutter); the merge then happens on his explicit go. 5. Per-site DMARC tightening later (stays `p=none` now). +6. Confirm the dark-mode mail card in the Gmail app (Gmail and non-Gmail account) and Outlook with a real test mail; the layout uses inline styles and Outlook selectors but the clients' own colour conversion cannot be tested in code. +7. Decisions left to Bryan (not built): own rate-limit policy for `Setup/status`, judging the admin token only on a real block (log noise), a visible error state with "Reload" and a fetch timeout; the contact-feature gate change is in `features/contact-feature/contact-feature-prereqs.md`. +8. CI of run 635 (65ee73f) was not confirmed green when this was written. ## Overall Readiness - **Ready for Production**: Not yet. SlpSoftware production needs the real test mails, the alert rule and Bryan's approval; ASF production is a separate piece of work.