Skip to content

GET /v3/memories returns 500 when memory record missing 'user_review' field #4498

Closed

Description

@beastoin

Description

Users are unable to load memories in the app due to a KeyError in the backend.

Root Cause

backend/database/memories.py:94 uses direct dict access instead of .get():

# Current (buggy):
result = [memory for memory in memories if memory['user_review'] is not False]

# Fix:
result = [memory for memory in memories if memory.get('user_review') is not False]

Impact

  • Any user with a memory record missing the user_review field gets a 500 error
  • Their entire memories list fails to load in the app
  • Confirmed via Grafana logs showing multiple 500 errors on /v3/memories endpoint

Steps to Reproduce

  1. User has a memory document in Firestore without user_review field
  2. User opens app and navigates to memories
  3. App calls GET /v3/memories
  4. Backend crashes with KeyError: 'user_review'

Suggested Fix

Use .get('user_review') instead of ['user_review'] on line 94 of backend/database/memories.py

Environment

  • Endpoint: GET /v3/memories
  • File: backend/database/memories.py:94

Reported by @mon via Grafana monitoring

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainermemoryp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions