Skip to content

Verify calendar background_color deserialization from camelCase API #14

@dmwyatt

Description

@dmwyatt

Problem

The Granola API returns calendar data with Google Calendar field naming conventions (camelCase), including backgroundColor. Our model struct has background_color: Option<String> but does NOT have a #[serde(alias = "backgroundColor")] attribute on it (unlike other CalendarEvent fields which do have aliases).

The Calendar struct uses #[serde(flatten)] for its extra HashMap, so backgroundColor from the API may be silently captured in extra rather than populating the background_color field. If so, the DB column background_color would always be NULL even when the API provides the value.

Investigation steps

  1. Check if serde_json with #[serde(flatten)] on Calendar captures backgroundColor in extra or maps it to background_color
  2. Query the local DB: SELECT background_color FROM calendars WHERE background_color IS NOT NULL — if all NULL, the field isn't being mapped
  3. Use scripts/granola-api.py to inspect raw calendar API responses and confirm the field name
  4. If mismatched, add #[serde(alias = "backgroundColor")] to the field or rename appropriately

Related

  • #241 — parent audit issue
  • Discovered during field name mismatch audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio: p2Medium priority, normal queuesize: sSmall, quick fixstatus: readyReady to be worked ontype: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions