diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 364f374..98c21d6 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -61,13 +61,31 @@ export default async function RootLayout({ const parsed = JSON.parse(decoded); initialMarriageJson = decoded; initialProfile = getInitialMarriageProfile(parsed); + console.log("🖥️ [SSR Layout] Parsed rawMarriageCookie successfully:", { + status: initialProfile?.status, + gender: initialProfile?.gender, + has_match_summary: Boolean(initialProfile?.match_summary), + match_summary_id: initialProfile?.match_summary?.id, + public_info_count: initialProfile?.match_summary?.public_info?.length, + }); } catch { try { const parsed = JSON.parse(rawMarriageCookie); initialMarriageJson = rawMarriageCookie; initialProfile = getInitialMarriageProfile(parsed); - } catch {} + console.log("🖥️ [SSR Layout] Parsed rawMarriageCookie (non-decoded) successfully:", { + status: initialProfile?.status, + gender: initialProfile?.gender, + has_match_summary: Boolean(initialProfile?.match_summary), + match_summary_id: initialProfile?.match_summary?.id, + public_info_count: initialProfile?.match_summary?.public_info?.length, + }); + } catch (e) { + console.warn("🖥️ [SSR Layout] Failed to parse rawMarriageCookie:", e); + } } + } else { + console.log("🖥️ [SSR Layout] No rawMarriageCookie found in request cookies"); } return ( diff --git a/src/app/providers.tsx b/src/app/providers.tsx index e5a8d84..0963f7f 100644 --- a/src/app/providers.tsx +++ b/src/app/providers.tsx @@ -44,7 +44,17 @@ export default function Providers({ children, initialProfile }: ProvidersProps) }, }); if (initialProfile) { + console.log("⚡ [Providers] Initializing QueryClient cache with SSR initialProfile:", { + id: initialProfile.id, + status: initialProfile.status, + gender: initialProfile.gender, + has_match_summary: Boolean(initialProfile.match_summary), + match_summary_id: initialProfile.match_summary?.id, + public_info_count: initialProfile.match_summary?.public_info?.length, + }); qc.setQueryData(marriageQueryKeys.profile(), initialProfile); + } else { + console.log("ℹ️ [Providers] No initialProfile passed from SSR"); } return qc; },