## Summary - Fixes [PHP-LARAVEL-9](https://whisper-money.sentry.io/issues/PHP-LARAVEL-9): `ReferenceError: window is not defined` during Inertia SSR of `CashflowPage`. - `CashflowController` now reads + validates the `period` query param (`YYYY-MM`) and passes it as an Inertia prop. - Client `useState` initializer reads from `usePage().props.period` instead of `window.location.search`, making SSR safe and avoiding hydration mismatch. - `useEffect` URL sync now compares against the prop, not `window.location.search`. ## Why (c) not a `typeof window` guard Server-provided params avoid hydration mismatch and keep URL as single source of truth. ## Tests New `tests/Feature/CashflowPageTest.php`: - guest redirect - no query param → `period` prop `null` - valid `?period=2025-03` → prop `'2025-03'` - invalid value → `null` - malformed format (`2025-3`) → `null` All 5 pass (50 assertions). ## Scope Cashflow only. Other pages with similar `window.location.search` in `useState` initializers (`onboarding/index.tsx`, `welcome.tsx`, `auth/login.tsx`) left for follow-up. Fixes PHP-LARAVEL-9 |
||
|---|---|---|
| .. | ||
| Controllers | ||
| Middleware | ||
| Requests | ||
| Responses | ||