From 5e6ed38ca49d38faf68c2706501f4d30bf9acbbf Mon Sep 17 00:00:00 2001 From: gilesb Date: Sun, 11 Jan 2026 23:54:56 +0000 Subject: [PATCH] Improve recipe listing - check both uploader and owner - Add better debug logging for recipe filtering - Check both uploader and owner fields when filtering by actor_id - This handles S-expression recipes that use 'owner' field Co-Authored-By: Claude Opus 4.5 --- app/services/recipe_service.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/services/recipe_service.py b/app/services/recipe_service.py index dfe5ad2..96d37d3 100644 --- a/app/services/recipe_service.py +++ b/app/services/recipe_service.py @@ -127,15 +127,19 @@ class RecipeService: # Check if cache has a list method for recipes if hasattr(self.cache, 'list_by_type'): items = self.cache.list_by_type('recipe') - logger.info(f"Found {len(items)} recipe items in cache") + logger.info(f"Found {len(items)} recipe items in cache for actor_id={actor_id}") for content_hash in items: recipe = await self.get_recipe(content_hash) if recipe: uploader = recipe.get("uploader") - logger.info(f"Recipe {content_hash[:12]}: uploader={uploader}, actor_id={actor_id}") + owner = recipe.get("owner") + logger.info(f"Recipe {content_hash[:12]}: name={recipe.get('name')}, uploader={uploader}, owner={owner}, actor_id={actor_id}") # Filter by actor - L1 is per-user - if actor_id is None or uploader == actor_id: + # Check both uploader and owner fields for flexibility + if actor_id is None or uploader == actor_id or owner == actor_id: recipes.append(recipe) + else: + logger.warning("Cache does not have list_by_type method") # Sort by name recipes.sort(key=lambda r: r.get("name", ""))