From 54e2a9e74fad02e2310cff5501c4349a54438fdb Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sat, 31 Jan 2026 20:29:48 +0100 Subject: [PATCH] feat: add logging for subscription current_period_end in OrganizationSettings component; implement data ingestion for debugging purposes --- components/settings/OrganizationSettings.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/settings/OrganizationSettings.tsx b/components/settings/OrganizationSettings.tsx index 4a873be..62bd97f 100644 --- a/components/settings/OrganizationSettings.tsx +++ b/components/settings/OrganizationSettings.tsx @@ -99,6 +99,13 @@ export default function OrganizationSettings() { setIsLoadingSubscription(true) try { const sub = await getSubscription() + // #region agent log + try { + const raw = (sub as { current_period_end?: unknown }).current_period_end + const parsed = raw != null ? new Date(raw as string | number).getTime() : null + fetch('http://127.0.0.1:7243/ingest/50587964-c1c6-436a-a7ce-ff2cde3c5b63', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ hypothesisId: 'H3,H5', location: 'OrganizationSettings.tsx:loadSubscription', message: 'subscription.current_period_end received', data: { type: typeof raw, raw, parsed, display: raw != null ? new Date(raw as string | number).toLocaleDateString() : null }, timestamp: Date.now(), sessionId: 'debug-session' }) }).catch(() => {}) + } catch (_) {} + // #endregion setSubscription(sub) } catch (error) { console.error('Failed to load subscription:', error)