-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Bug: The createRecipeRealtimeService() factory is never called, disabling real-time recipe updates.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The refactoring of the recipe module's realtime service changed initializeRecipeRealtime() from a direct export to an internal function within createRecipeRealtimeService(). However, createRecipeRealtimeService() is never instantiated or called, leading to initializeRecipeRealtime() never being executed. Consequently, the recipe realtime subscription is never established, preventing real-time updates (INSERT, UPDATE, DELETE) from Supabase from being processed, and causing users to see stale recipe data.
💡 Suggested Fix
Instantiate and call createRecipeRealtimeService() in the appropriate use-case file (e.g., recipeUseCases.ts) and then call initializeRecipeRealtime() from the returned service object, similar to other modules.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/modules/diet/recipe/infrastructure/supabase/realtime.ts#L7-L73
Potential issue: The refactoring of the recipe module's realtime service changed
`initializeRecipeRealtime()` from a direct export to an internal function within
`createRecipeRealtimeService()`. However, `createRecipeRealtimeService()` is never
instantiated or called, leading to `initializeRecipeRealtime()` never being executed.
Consequently, the recipe realtime subscription is never established, preventing
real-time updates (INSERT, UPDATE, DELETE) from Supabase from being processed, and
causing users to see stale recipe data.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5958302
Originally posted by @sentry[bot] in #1457 (comment)