Skip to content

Fix IP asset fetch pipeline: owner filtering, local caching, error surfacing#1

Open
creativemuse wants to merge 1 commit into
mainfrom
cto/fix-ip-asset-pipeline
Open

Fix IP asset fetch pipeline: owner filtering, local caching, error surfacing#1
creativemuse wants to merge 1 commit into
mainfrom
cto/fix-ip-asset-pipeline

Conversation

@creativemuse

Copy link
Copy Markdown
Owner

Summary

  • Owner filtering: GET_USER_IP_ASSETS GraphQL query now filters by caller (wallet address) so Launchpad shows only the connected user's assets
  • Local DB caching: New LocalIPAsset Prisma model persists assets immediately after Crossmint registration, giving instant visibility before the Goldsky subgraph indexes the on-chain event
  • Merged data sources: Launchpad fetches from both subgraph and local DB in parallel, deduplicating by storyProtocolId
  • Metadata error surfacing: New metadataStatus field (loading/loaded/failed) with UI warning badge on IPCard when metadata is unavailable
  • Retry with backoff: Metadata fetches from Grove/IPFS now retry up to 3 times with exponential backoff

Files changed

  • lib/graphql.ts — owner filter, metadataStatus, retry logic
  • prisma/schema.prisma — new LocalIPAsset model
  • app/api/register-ip/route.ts — persist to local DB after Crossmint success
  • app/api/my-assets/route.ts — new endpoint to query local assets by owner
  • components/launchpad.tsx — merged data sources with dedup
  • components/ip-card.tsx — metadata failure warning badge

Test plan

  • Connect wallet and verify only your own assets appear in Launchpad
  • Register a new IP asset and confirm it appears immediately (before subgraph indexes)
  • Verify that once the subgraph indexes the asset, no duplicates appear
  • Simulate metadata fetch failure and verify the warning badge shows
  • Run npx prisma db push to apply the schema migration

🤖 Generated with Claude Code

…surfacing

- Add owner/wallet address filter to GET_USER_IP_ASSETS GraphQL query so
  Launchpad shows only the connected user's assets
- Add LocalIPAsset Prisma model for immediate DB persistence after
  Crossmint registration (before subgraph indexes)
- Add /api/my-assets endpoint to query local DB assets by owner
- Merge subgraph + local DB data in Launchpad with deduplication by
  storyProtocolId
- Add metadataStatus field (loading/loaded/failed) to surface metadata
  fetch errors in the UI via warning badge on IPCard
- Add retry with exponential backoff for Grove/IPFS metadata fetches

Co-Authored-By: Paperclip <noreply@paperclip.ing>
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