Endpoint /api/social/profile/[userId] returned (profile as any).postsCount ?? 0
und (profile as any).followingCount ?? 0 — Profile-schema hat aber weder
postsCount noch followingCount columns. Daher zeigte UI immer 0 obwohl User
Posts hatte.
Fix: 2 zusätzliche COUNT-queries in Promise.all:
- usePrisma().communityPost.count({ userId, isModerated: false }) → postsCount
- usePrisma().userFollow.count({ followerId: userId }) → followingCount
followersCount bleibt unverändert (wird via trigger denormalisiert in profile-row).
Tests: backend/tests/social/profile-counts.test.ts — 4 Cases
(posts>0, posts=0, following count, followers passthrough). 4/4 grün.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Endpoint /api/social/profile/[userId] returned (profile as any).postsCount ?? 0
und (profile as any).followingCount ?? 0 — Profile-schema hat aber weder
postsCount noch followingCount columns. Daher zeigte UI immer 0 obwohl User
Posts hatte.
Fix: 2 zusätzliche COUNT-queries in Promise.all:
- usePrisma().communityPost.count({ userId, isModerated: false }) → postsCount
- usePrisma().userFollow.count({ followerId: userId }) → followingCount
followersCount bleibt unverändert (wird via trigger denormalisiert in profile-row).
Tests: backend/tests/social/profile-counts.test.ts — 4 Cases
(posts>0, posts=0, following count, followers passthrough). 4/4 grün.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
User-Bug: Demographics werden korrekt gespeichert (DB verified), aber nach
Page-Reload sah User leere Felder → dachte save kaputt. Root: kein GET-endpoint
+ kein server-state-rehydrate nach PATCH.
- hooks/useProfileData.ts: useDemographics() wraps useFetchOnce<DemographicsResponse>
('/api/profile/me/demographics'), splittet in fields + meta (consentAt/withdrawnAt)
- app/profile/index.tsx: serverDemographics ?? EMPTY_DEMOGRAPHICS const statt local
state. Nach PATCH/DELETE: reloadDemographics() pulled fresh server data.
Edge-cases:
- 404 (endpoint nicht live) → fallback EMPTY, kein crash
- loading → EMPTY initial bis fetch resolved, konsistent mit other hooks
- withdrawnAt set → demoComplete=false (Demographics-Hint sichtbar trotz potentiell
noch befüllter felder durch race-condition)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Backend wirft 403 device_limit_reached für ALLE auth'd endpoints sobald User über
plan-limit ist. Bisheriges Frontend hat silent gefailt → Profile/Notifications/etc
zeigten nichts mehr, User war verwirrt.
Now:
- lib/api.ts: 403 device_limit_reached intercepten, parse error.data.devices,
trigger useDeviceLimitStore.show()
- stores/deviceLimit.ts: Zustand store (visible, devices, max, plan, show/hide)
- components/DeviceLimitReachedSheet.tsx: TrueSheet (UISheetPresentationController)
Auto-präsentiert wenn store visible, zeigt device-list mit trash-button per Eintrag,
DELETE /api/devices/:id mit skipDeviceHeader: true (sonst circular 403)
- app/_layout.tsx: <DeviceLimitReachedSheet /> als globaler overlay vor <Stack>
- i18n: device_limit_* keys DE+EN
UX: User sieht jetzt sofort native bottom-sheet mit erklärung + actionable
device-list statt silent fail. Auto-close wenn devices.length < max nach delete.
TS-fix: detents={['auto', 1] satisfies SheetDetent[]}, onDidDismiss statt onDismiss
(prop heißt anders in TrueSheet API).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Profile (rebreak-native-ui):
- New hook hooks/useProfileData.ts (143 LOC, 4 hooks):
useSocialStats, useApprovedDomains, useCooldownHistory, useSosInsights
- app/profile/index.tsx: alle DUMMY_* constants entfernt → live data via hooks
- PATCH /api/profile/me/demographics nun wired in onChange (war TODO-only)
- DELETE /api/profile/me/demographics für revoke-consent
- POST /api/profile/me/diga-banner-dismiss
Devices (rebreak-native-ui):
- New app/devices.tsx push-page: slot-counter, progress-bar, device-list mit
trash-button (gesperrt für isCurrent)
- New lib/deviceId.ts: persistent device-ID via expo-application
(getIosIdForVendorAsync / getAndroidId) mit AsyncStorage-UUID-fallback
- New stores/devices.ts: Zustand store (loadDevices, removeDevice, ensureRegistered)
- lib/api.ts: x-device-id + x-platform headers bei jedem Backend-Call
(skipDeviceHeader option für Bootstrap-register)
- app/settings.tsx: Geräte-Row aktiv (push to /devices) statt soon-flagged
- locales: 14 neue settings.devices_* keys DE+EN
Backend-Status: alle Devices-Endpoints existieren (GET /api/devices, POST /register,
DELETE /:id). Pending: GET /api/profile/me/demographics für reload-state-fetch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- expo-router 6 (per Phase 1 upgrade): all our imports remain valid
(Stack, useLocalSearchParams, useRouter, useFocusEffect, withLayoutContext,
RelativePathString). No `Href<T>` generic usage in codebase. expo-splash-screen
already explicit in deps. Zero code changes needed for router-6 migration.
- Register expo-font + expo-web-browser as plugins per `expo install --fix`
recommendation. Both already in deps but plugins block missing.
TS: 0 errors. Bundle still works.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wenn marker sichtbar nach Rebuild: ProfileHeader fully rendered,
StatsBar+below werden danach suppressed (background-overlay,
fix-height container, oder ähnlich). Wenn marker nicht sichtbar:
ProfileHeader-Render aborts mid-tree. TEMP, wird wieder entfernt.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
stores/language.ts:
- init() override AsyncStorage-Wert nicht — wenn nichts gespeichert,
i18n bleibt bei deviceLocale (von lib/i18n.ts via Localization.getLocales).
Vorher: forced 'en' default obwohl App auf DE.
ComposeCard share-button:
- borderRadius:12 + height:50 → rounded-full px-5 h-11 (44pt)
- text-base → text-sm. Pill-Pattern wie Pre-Session.
app/profile/index.tsx:
- AppHeader title "Profil" → "Profil DEBUG-2300" — TEMPORARY marker
zur Verifikation ob File geladen wird (user-suspect: routing zu altem
File). Wird nach Test wieder entfernt.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hermes wirft "property is not writable" + "Cannot read 'default' of undefined"
wenn beim Module-Load eines Stores native APIs aufgerufen werden bevor
die Bridge bereit ist. Die initialen Werte:
- theme: colorScheme war resolveColorScheme('system') → ruft Appearance.getColorScheme()
zur Module-Load-Zeit. Jetzt: 'light' als default; korrekter Wert kommt
asynchron via init().
- language: language war (i18n.language === 'de' ? 'de' : 'en') → liest
i18n.language zur Module-Load-Zeit (Risiko falls i18n noch nicht init).
Jetzt: 'en' default; korrekter Wert kommt via init() das i18n.changeLanguage
callt.
Init-Calls passieren in _layout.tsx useEffect — nach Bridge-bereit, nach
Hermes-Eval-Phase. Sicher.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diagnose: ComposeCard ist ListHeaderComponent der FlatList die
keyboardShouldPersistTaps="handled" hat. Aber das Prop propagiert nicht
rekursiv durch tiefere View-Ketten — der Share-Button-Pressable liegt
zu tief, der erste Tap dismissed nur die Tastatur.
Fix: onPress → onPressIn (fired beim Touch-Down vor Keyboard-Dismiss-
Logic). Identisch zum Pattern beim Bild-Icon. Guard if(!content.trim()
|| posting) repliziert die disabled-Logik die onPress hatte.
Style: native iOS Primary-Action-Button-Look:
- height 44→50, px-5→px-6
- rounded-full → borderRadius 12 (Rectangle statt Pill)
- Nunito_700Bold → 600SemiBold
- Plain text "Teilen", kein Icon
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ComposeCard:
- paper-plane-Icon entfernt, h:52→44, px-6→5, layout flex-row gap-2 →
items-center justify-center, only Text. Saubere Pill ohne Icon-Gewicht.
- i18n-Key community.share war schon da — kein neuer Key.
HeaderDropdownMenu:
- minWidth 170→210, numberOfLines={1} auf Item-Labels entfernt (Breite
reicht jetzt fuer alle Labels). numberOfLines bei SOS-Block-Labels
bleibt (zwei separate Text-Nodes, sinnvoll).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(app)/index.tsx:
- FlatList keyboardShouldPersistTaps="handled" — Bild-Icon im ComposeCard
reagiert ab erstem Tap auch wenn Tastatur offen. Vorher dismisste der
Tap nur die Tastatur (RN-Default "never").
ComposeCard.tsx Teilen-Button:
- height 44→52, px-5→px-6, paper-plane-outline-Icon size 18 + text-base
Nunito_700Bold. Standard-iOS-Filled-Primary-Button-Style.
AppHeader.tsx Bell + Avatar:
- hitSlop 4pt allseitig auf beiden Pressables — effective tap-area
36→44pt ohne Layout-Verschiebung
- Bell-Icon size 18→22 (konsistent mit Avatar-36pt-Kreis)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coach-Page ist NICHT SOS — User ist nicht in Krise, will small-talk,
Reflexion, Feature-Wuensche, Philosophie. „Lockere Lyra".
Aenderungen:
- Neuer Prompt COACH_CASUAL_SYSTEM_PROMPT (exportiert): warm/neugierig/
manchmal humorvoll, bis 4-5 Saetze, darf eigene Empfehlungen + Mini-
Meinungen formulieren, lädt Feedback aktiv ein. Kein Crisis-Framing.
Sprachregeln (keine Pathologisierung, kein „Sucht") gelten unveraendert.
- Tier-LLM-Routing analog zu sos-stream:
Free/Pro = Groq llama-3.3-70b-versatile (Fallback llama-3.1-8b)
Legend = OpenRouter anthropic/claude-haiku-4.5 (Fallback claude-3.5-haiku)
- max_tokens 280→500 (Coach darf laenger antworten)
- Demographics-Injection (analog sos-stream): birthYear/gender/etc als
USER-DEMOGRAPHIE-Block in Prompt (read-only, kein Extract)
- sosMode-Branch deprecated — Frontend kann den Param noch senden, wird
ignoriert. Folge-TODO: UI-Agent entfernt sosMode aus Coach-Call.
NICHT geändert:
- TTS-Endpoints bleiben plan-agnostisch (Frontend routet by tier)
- sos-stream.get.ts/sos-stream.post.ts unberuehrt (importieren weiter
COACH_SYSTEM_PROMPT, kein Breaking Change)
Memory:
- project_llm_per_plan.md (tier-LLM-Default-Logic)
- feedback_anonymity_nickname.md
- feedback_demographics_user_initiated.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Profile:
- Hint "fuelle deine anonymen Daten aus" oeffnet das DemographicsAccordion
jetzt automatisch via expanded-Prop + useEffect mit LayoutAnimation.
Vorher: scrollte hin, liess es geschlossen, User musste nochmal tappen.
- DemographicsAccordion: expanded-Prop fuer external-trigger; interner
expandedLocal-State, Toggle-Button bleibt unabhaengig functional.
ProtectionDetailsSheet FAQ:
- chevron-forward (0deg→90deg Rotation, sah aus wie Nav-Link) → chevron-down
(0deg→180deg). Geschlossen=runter, offen=hoch. State-Toggling war schon
korrekt, nur visuelle Affordance war falsch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
let profile vor try-block hoisten, damit es im plan-routing-Fallback
(line 210, profile?.plan) sichtbar ist. Vorher: const profile innerhalb
try-block → block-scoped → ReferenceError außerhalb.
Demographics-Block-Injection added — gracefully no-op wenn neue Felder
(birthYear/gender/etc.) noch nicht im DB-Schema sind (optional chaining).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- urge.tsx: TtsProviderToggle + LlmProviderToggle entfernt (Testing durch);
Core-Logic (useTtsProvider, currentLlmProvider, BenchSession) bleibt für
spätere Debug-Page intakt
- DemographicsAccordion FieldRow: flex:1 auf Label-Text, kein flexShrink-
Wrapper mehr nötig; Label+Input wrappen nicht mehr auf schmalen Devices
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Hostname (staging.rebreak.org) und User (root) sind keine echten Secrets —
public DNS bzw. in Doku schon erwähnt. Variables sichtbar in Logs erleichtert
Debug (siehe DNS-Fail mit "getaddrinfo ***" — bei vars wäre der konkrete
Wert lesbar gewesen).
Aufteilung jetzt:
- HETZNER_SSH_KEY → secret (sensitive: Server-Root-Zugang)
- HETZNER_HOST → var (public DNS)
- HETZNER_USER → var (in Doku)
Plus echo des Host-Werts in Setup-SSH-Step für Debug-Visibility.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pnpm/action-setup@v4 errored out weil sowohl `version: 10` im Workflow
als auch `packageManager: pnpm@10.23.0` in package.json gesetzt waren.
package.json bleibt source-of-truth, version aus Workflow raus.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CX23 (4GB RAM) OOM'd am 2026-05-06 während webhook-getriggertem `pnpm build`
(Heap-Limit 1.5GB überschritten). Build raus aus Server, GitHub-Runner (7GB RAM)
übernimmt — Server deployed nur noch Artifact via scp + atomic-mv + pm2 restart.
- .github/workflows/deploy-staging.yml: 2-Job (build + deploy via SSH-Artifact-Push)
- scripts/deploy-from-artifact.sh: Server-Script mit Migration-Detection + atomic-mv
- ops/GITHUB_ACTIONS_PIPELINE.md: Architektur-Doku + Cheatsheet
Coexistence: alter rebreak-webhook bleibt als Failsafe, wird nach 5+ erfolgreichen
GA-Runs deaktiviert. Erster Run: Webhook temporär gestoppt für sauberen Test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Step 2.5 zwischen pnpm install und build:
- git diff vs .last-deployed-sha auf prisma/migrations + schema.prisma
- bei Änderungen: pnpm prisma migrate deploy via infisical run wrapper
(idempotent, conservative — abort bei Fail vor pm2-restart)
- DATABASE_URL Fallback auf NUXT_DATABASE_URL analog start-staging.sh
Step 8: persistiert HEAD-SHA in .last-deployed-sha
.gitignore: .last-deployed-sha (server-only artifact)
Edge cases:
- First-deploy: .last-deployed-sha fehlt → run_migration=true (sicher dank
Idempotenz)
- Infisical-Login-Fail: abort vor pm2-restart
- Migration-Fail: exit 1, alter Code läuft auf alter DB sauber
Old-trucko-Pattern (deploy.sh:58-65) macht migrate deploy unconditional;
rebreak-Variante macht es conditional → spart Infisical+DB-Roundtrip wenn
keine Migration-Files berührt wurden.
Lyra halluzinierte Namen wie 'Max' im SOS-Stream weil systemPrompt
keinen Nicknamen-Anker hatte. message.post.ts hatte das Pattern schon,
aber beim Cutover ins backend/-Layout war's nur dort, nicht in
sos-stream.{get,post}.ts.
Fix: getProfile(user.id) + Inject 'NUTZER-NAME: ...' wie in message.post.ts.
Non-blocking (catch), Memory-Pattern preserved.
Im Cutover wurde 'const key = config.openrouterApiKey' rausgenommen,
aber line 311 referenzierte 'key' weiter für extractAndStoreMemories.
ReferenceError fiel in catch → 'stream failed' SSE event → App
fiel auf non-streaming fallback (4-5s wait) statt streaming.
Fix: explizit memoryExtractKey aus config.openrouterApiKey holen.
- SUPABASE_KEY/SERVICE_KEY → SUPABASE_ANON_KEY/SERVICE_ROLE_KEY aliasing
- NUXT_*_API_KEY → fallback to non-prefixed
- NITRO_-Prefix mapping für runtimeConfig-Runtime-Override
(Nitro standalone bracht NITRO_X-prefix zur runtime override des
build-time defaults, da Build außerhalb infisical run wrapper läuft)
Verified live auf rebreak-staging: HTTP /api/auth/me mit fake bearer
gibt jetzt 401 statt 500.
Phase-1-Vorbereitung für den Rebreak-Cutover (apps/rebreak Nuxt → backend
standalone Nitro). Alle Änderungen sind lokal verifiziert (build = 9.66 MB
gzipped 3.08 MB, node .output/server/index.mjs startet ohne ERR_MODULE_NOT_FOUND
auf :3000). Kein Push, kein Server-Eingriff in dieser Session.
Inhalt:
- backend/nitro.config.ts: 8 zusätzliche runtimeConfig-Keys (cartesia*, eleven*,
supabaseUrl/AnonKey/ServiceKey, public.supabase.{url,key}). Schließt den
Auth-500-Cascade vom 2026-05-06 (server/utils/auth.ts:32 liest
config.public.supabase ?? config.supabase — beide Pfade jetzt deklariert).
- .npmrc (NEU, root-level): node-linker=hoisted für Prisma 7 transitive
@prisma/client-runtime-utils (siehe feedback_backend_runtime_config.md).
- backend/start-staging.sh: Pfad korrigiert von /srv/rebreak-monorepo/...
→ /srv/rebreak/backend/.output-staging/server/index.mjs. infisical run
wrapper (kein NUXT_*-Mapping mehr — runtimeConfig liest process.env.X
direkt). IMAP-Services entfernt (sind Mo's Scope, separat in ecosystem).
- scripts/deploy.sh (NEU): adaptiert von /srv/rebreak/scripts/deploy.sh
für backend/-Layout. APP_DIR=backend, pnpm --filter rebreak-backend build,
.output → .output-staging atomic-move bleibt erhalten, pm2 restart
--update-env zieht neue Infisical-Secrets.
- scripts/deploy-webhook/server.mjs (NEU): 1:1-Kopie vom Server, damit
ecosystem.config.js auf die Repo-Version zeigen kann.
- ecosystem.config.js (NEU, root-level): rebreak-staging zeigt auf
backend/start-staging.sh, rebreak-webhook zeigt auf scripts/deploy-webhook.
rebreak-prod + dns-* sind kommentiert (folgen in späterer Phase).
- ops/CUTOVER_PLAN.md: Plan-Doku vom 2026-05-06 (yesterday's work).
- .gitignore: .claude/ und xgit ergänzt (lokale Agent-State, nicht versioniert).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mein vorheriger Push hatte ältere ops/nginx/-Versionen aus dem rebreak-monorepo.
Server hatte ACME-Challenge, security-Headers (HSTS, X-Frame-Options, X-XSS),
separate /webhook Location, X-Robots-Tag — alles war im Repo nicht drin.
Geänderte/neue files:
- staging.rebreak.org.conf — full version mit ACME + security
- db-staging.rebreak.org.conf — minimal diff
- default.conf — NEU
- rebreak-staging-new.conf — NEU
Live nginx selbst war nicht betroffen (nginx -t ok), Repo-Sources jetzt
auf Live-Stand synchronisiert.