Skip to content

Conversation

@rawcomposition
Copy link
Owner

@rawcomposition rawcomposition commented Dec 24, 2025

Note

Introduces a dedicated LegacyImage collection and migrates legacy images into it, updating image retrieval to rely on this new source.

  • New models/LegacyImage Mongoose model with indexes; added LegacyImage TypeScript type
  • Script scripts/migrate-images.ts to batch-migrate non-eBird images from Hotspot/Group docs into LegacyImage; added npm script migrate-images
  • Refactors getHotspotImages to query LegacyImage (non-map, non-migrated) instead of embedded images, combine with featured ML/eBird images, and update featuredImg accordingly
  • Type tweak: Image.lgUrl is now optional to align with legacy records

Written by Cursor Bugbot for commit 57b37e2. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

type: String,
enum: ["hotspot", "group"],
required: true,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type enum mismatch between TypeScript and Mongoose schema

The LegacyImage TypeScript type in lib/types.ts defines type as "hotspot" | "group" | "drive", but the Mongoose schema in models/LegacyImage.ts only allows enum: ["hotspot", "group"]. Since the Drive model has an images array, attempting to create a LegacyImage with type: "drive" will pass TypeScript validation but fail at runtime with a Mongoose validation error.

Additional Locations (1)

Fix in Cursor Fix in Web

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants