Skip to content

animals.updatedAt doesn't exist in the RG v5 API — dead half of newestTimestamp() #39

Description

@BrandonML

What

server/rescuegroups.js requests and reads an updatedAt attribute on animal records alongside updatedDate:

  • ANIMAL_FIELDS includes both "updatedDate" and "updatedAt" in the fields[animals] request.
  • normalizeCards computes updatedAt: newestTimestamp(attrs.updatedDate, attrs.updatedAt), taking whichever of the two is more recent.

updatedAt isn't a real field on the animals resource. The v5 schema reference only lists updatedDate ("Last updated") for animals — there's no updatedAt. Confirmed live: requesting fields[animals]=name,updatedDate,updatedAt,createdDate against /public/animals/search/available/cats/ returns updatedDate and createdDate on every record, but updatedAt never appears (the v5 API omits null/nonexistent attributes rather than returning them empty, per its Oct 2019 changelog).

Impact

None today — timestampValue(undefined) returns null, newestTimestamp filters out null candidates, so it silently falls back to updatedDate alone every time. attrs.updatedAt is always undefined in practice, so this is dead code, not a live bug.

Fix

Simplify normalizeCards to use attrs.updatedDate directly and drop "updatedAt" from ANIMAL_FIELDS and the newestTimestamp merge — no behavior change, just removes the dead branch and the wasted field request.

Found while investigating animal-update freshness for a RescueGroups org-outreach data pull (unrelated task) — not urgent, low risk, small cleanup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions