Migration saigon-happy-hour-sniper to Tinyfish SDK #138
Migration saigon-happy-hour-sniper to Tinyfish SDK #138KrishnaAgarwal7531 wants to merge 4 commits intotinyfish-io:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
simantak-dabhade
left a comment
There was a problem hiding this comment.
Thanks for ripping out the Supabase layer — the core code migration is solid. Blocking on this: the Supabase removal is incomplete. The README still documents it as first-class, and a few code paths still reference it (no longer functional, but dead). Please do a scrub pass so the docs and code reflect the new reality.
README
- Running locally (lines 106–115) — tells users to create
.env.localwithNEXT_PUBLIC_SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEY, neither of which the app reads. Should say: copy.env.exampleto.envand fill inTINYFISH_API_KEY. - "How it works" flow (lines 36, 38, 42) — remove the "Cache hit / Cache miss / upsert to cache" branching; there's no cache path anymore.
- Tech stack table (line 92) — drop the
Caching | Supabase (Postgres)row. - Architecture diagram (lines 129–150) — remove the Supabase node, cache-hit branch, and
deal_cachetable. Flow is just: Browser → Next.js API route → parallel TinyFish agents → venue sites → stream back. - Features (lines 174, 176) — drop "Graceful degradation — App works without Supabase" and "Smart caching — 6-hour TTL". Both describe removed functionality.
- Project structure (lines 185–201) — several mismatches:
hooks/use-search.ts→ actual file isuse-deal-search.tslib/supabase.ts→ deleted, remove the linecomponents/search-form.tsxanddeal-card.tsx→ don't exist- Missing:
components/deal-badge.tsx,components/venue-card.tsx - Route comment says "cache lookup + TinyFish orchestration" — drop the cache lookup bit.
Code (dangling cache refs)
src/lib/district-sites.ts:54—CACHE_TTL_MSexported but nothing imports it.src/lib/types.ts:35–36—source?: 'cache' | 'live'andcached_at?fields are never populated anymore (API route always emitssource: "live").src/components/venue-card.tsx:97,112–115—isCachedbranch renders a "Cached" badge that can no longer trigger.src/app/page.tsx:258— comment says "cache toggle" but there's no toggle; drop the comment.
Everything else passes review: SDK usage, no Mino refs, .env.example, .gitignore, CI all green. Once the docs + dead refs are cleaned up, I'll do the local test pass and approve.
simantak-dabhade
left a comment
There was a problem hiding this comment.
README and dead cache refs from the last review are both fully fixed — nice work.
However, the cache cleanup was incomplete in a few spots and the build is now broken:
1. Build fails — venue.source assignment on removed field
src/hooks/use-deal-search.ts:115 assigns venue.source = 'live' but source was removed from the Venue type in lib/types.ts. Fix: delete line 115.
> 115 | venue.source = 'live';
2. 3 test failures (npx vitest run — 3 failed, 44 passed)
api-route.test.ts: assertstimeout: 780_000in TinyFish constructor, but route passes only{ apiKey }— stale assertion.api-route.test.ts: asserts"cached":0inSEARCH_COMPLETEpayload, but that field no longer exists — stale cache-era check.normalize.test.ts:277: expectsnullfor empty venue name, butnormalizeVenue()now falls back towebsite/address. Update expectations to match new behavior.
3. GROQ_API_KEY in .env.example is vestigial
.env.example lists GROQ_API_KEY (lines 5-6) but there are zero Groq references in src/. Remove it — will confuse users.
4. Nits (same fix pass):
REQUEST_TIMEOUT_MSexport inlib/district-sites.ts:53is never imported anywhere. Delete.route.tslines 41, 45, 59 still emitsource: "live"in the SSE payload but theVenuetype no longer has asourcefield and no consumer reads it. Remove.
Completes the Supabase removal that was started in the initial migration. The core SDK code was already solid — this PR scrubs the remaining dead references so the docs and code reflect what the app actually does.
Removed the cache hit/miss branching from the README, the Supabase env vars from the setup instructions, the CACHE_TTL_MS export nobody was importing, the source and cached_at fields from the Venue type, and the "Cached" badge from VenueCard that could never trigger. README fully rewritten to match reality.