Conversation
* fix(server): update roast controller, repository, routes and service * fix(firebase): update firebase-admin server initialization * fix(services): update roast client service and firestore subscription hook * fix(hooks): update useRoastProfile and useProfilesRealtime hooks * fix(ui): add delete confirm modal and update roast and profile card components * test: add unit tests for roast controller, service and client hooks * chore: update package-lock.json * fix: update import
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (19)
📝 WalkthroughWalkthroughThe roast generation flow is changed from a single-response JSON endpoint to SSE streaming end-to-end: the server service yields chunks via an async generator, the controller writes them as SSE events, and the client service reads the stream with an optional ChangesRoast SSE Streaming and Delete
Sequence Diagram(s)sequenceDiagram
participant DiscoverPage
participant useRoastProfile
participant requestRoast
participant Server as roast.controller
participant generateRoastStream
DiscoverPage->>useRoastProfile: executeRoast(persona)
useRoastProfile->>useRoastProfile: clear streamingText
useRoastProfile->>requestRoast: requestRoast(payload, onChunk)
requestRoast->>Server: POST /api/roast (SSE)
Server->>generateRoastStream: iterate chunks
generateRoastStream-->>Server: chunk text
Server-->>requestRoast: data: {"chunk": "..."}\n\n
requestRoast->>useRoastProfile: onChunk(text) → append streamingText
useRoastProfile-->>DiscoverPage: streamingText update → RoastModal re-renders
Server-->>requestRoast: data: [DONE]\n\n
requestRoast-->>useRoastProfile: resolve {roast: fullText}
useRoastProfile->>useRoastProfile: store roast in selectedProfile, clear streamingText
DiscoverPage->>useRoastProfile: executeDeleteRoast(persona)
useRoastProfile->>requestRoast: deleteRoast(memberId, persona)
requestRoast->>Server: DELETE /api/roast/:memberId?persona=brutal
Server-->>requestRoast: 200 OK
useRoastProfile->>useRoastProfile: clear roastBrutal in selectedProfile
useRoastProfile->>DiscoverPage: onDeleteSuccess → confirmDeleteOpen=false
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix(server): update roast controller, repository, routes and service
fix(firebase): update firebase-admin server initialization
fix(services): update roast client service and firestore subscription hook
fix(hooks): update useRoastProfile and useProfilesRealtime hooks
fix(ui): add delete confirm modal and update roast and profile card components
test: add unit tests for roast controller, service and client hooks
chore: update package-lock.json
fix: update import
Summary by CodeRabbit