mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:21:10 +02:00
- Add uload project with apps/web structure
- Reorganize from flat to monorepo structure
- Remove PocketBase binary and local data
- Update to pnpm and @uload/web namespace
- Add picture project to monorepo
- Remove embedded git repository
- Unify all package names to @{project}/{app} schema:
- @maerchenzauber/* (was @storyteller/*)
- @manacore/* (was manacore-*, manacore)
- @manadeck/* (was web, backend, manadeck)
- @memoro/* (was memoro-web, landing, memoro)
- @picture/* (already unified)
- @uload/web
- Add convenient dev scripts for all apps:
- pnpm dev:{project}:web
- pnpm dev:{project}:landing
- pnpm dev:{project}:mobile
- pnpm dev:{project}:backend
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2.5 KiB
2.5 KiB
🐛 process-jobs Function - Bug Fix Plan
Problem
Die process-jobs Edge Function wirft einen Runtime Error:
{"success":false,"error":"Cannot read properties of undefined (reading 'substring')"}
Root Cause Analysis
Der Fehler tritt auf, bevor unser Code überhaupt läuft. Mögliche Ursachen:
-
Import Problem:
import { processGeneration } from '../process-generation/index.ts';- Dieser relative Import könnte bei Deno/Edge Functions Probleme verursachen
- Das File wird zwar hochgeladen, aber vielleicht nicht korrekt aufgelöst
-
Supabase Client: Der createClient() Call schlägt fehl wenn SUPABASE_URL leer ist
- Der Error
reading 'substring'deutet auf URL-Parsing hin
- Der Error
Solution Options
Option A: Inline process-generation Code (EMPFOHLEN)
Pros:
- Keine Import-Probleme
- Alle Funktionalität in einer Datei
- Einfacher zu debuggen
Cons:
- Code-Duplizierung
- Größere Datei (~1000 Zeilen)
Option B: Fix Import Path
Pros:
- Saubere Code-Organisation
- Wiederverwendbarkeit
Cons:
- Schwierig zu debuggen
- Deno Import-Semantik kann tricky sein
Option C: Separate Functions (No Imports)
Pros:
- Klare Trennung
- Einfachere Edge Function
Cons:
- Mehr HTTP Overhead
- Komplexere Orchestrierung
Recommended Fix: Option A (Inline)
Da wir processGeneration nur in process-jobs verwenden, macht es Sinn, den Code zu inlinen.
Steps:
- Kopiere process-generation Code in process-jobs
- Entferne den Import
- Deploy und teste
Alternative Quick Fix
Falls das nicht funktioniert, können wir auch:
- Nur download-image Jobs verarbeiten
- generate-image Jobs über eine HTTP POST an process-generation delegieren
Testing Plan
-
Minimal Test:
curl -X POST \ https://mjuvnnjxwfwlmxjsgkqu.supabase.co/functions/v1/process-jobs \ -H 'Authorization: Bearer SERVICE_ROLE_KEY'Should return:
{"success": true, "processed": 0, "errors": 0} -
With Job Test:
-- Create test job SELECT enqueue_job( 'generate-image', '{"generation_id": "test", "prompt": "test", "model_id": "flux-schnell"}'::jsonb, 0 );Then trigger process-jobs and check if job is claimed.
-
Full E2E Test: Use start-generation with authenticated user and watch the full flow.
Implementation
Ich würde vorschlagen:
- Erstelle eine
process-jobs-v2.tsmit inline Code - Deploye als neue Function
- Teste
- Wenn erfolgreich, ersetze die alte
Will ich das jetzt implementieren?