Skip to content

Migration saigon-happy-hour-sniper to Tinyfish SDK #138

Open
KrishnaAgarwal7531 wants to merge 4 commits intotinyfish-io:mainfrom
KrishnaAgarwal7531:mig-saihon-happy-hour-sniper
Open

Migration saigon-happy-hour-sniper to Tinyfish SDK #138
KrishnaAgarwal7531 wants to merge 4 commits intotinyfish-io:mainfrom
KrishnaAgarwal7531:mig-saihon-happy-hour-sniper

Conversation

@KrishnaAgarwal7531
Copy link
Copy Markdown
Contributor

@KrishnaAgarwal7531 KrishnaAgarwal7531 commented Apr 7, 2026

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 642150e9-b377-47bf-8db3-b14b50d7fef0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@simantak-dabhade simantak-dabhade left a comment

Choose a reason for hiding this comment

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

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.local with NEXT_PUBLIC_SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY, neither of which the app reads. Should say: copy .env.example to .env and fill in TINYFISH_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_cache table. 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 is use-deal-search.ts
    • lib/supabase.ts → deleted, remove the line
    • components/search-form.tsx and deal-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:54CACHE_TTL_MS exported but nothing imports it.
  • src/lib/types.ts:35–36source?: 'cache' | 'live' and cached_at? fields are never populated anymore (API route always emits source: "live").
  • src/components/venue-card.tsx:97,112–115isCached branch 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.

@KrishnaAgarwal7531 KrishnaAgarwal7531 changed the title Migration saigon-happy-hour-sniper Migration saigon-happy-hour-sniper to Tinyfish SDK Apr 18, 2026
Copy link
Copy Markdown
Contributor

@simantak-dabhade simantak-dabhade left a comment

Choose a reason for hiding this comment

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

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: asserts timeout: 780_000 in TinyFish constructor, but route passes only { apiKey } — stale assertion.
  • api-route.test.ts: asserts "cached":0 in SEARCH_COMPLETE payload, but that field no longer exists — stale cache-era check.
  • normalize.test.ts:277: expects null for empty venue name, but normalizeVenue() now falls back to website/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_MS export in lib/district-sites.ts:53 is never imported anywhere. Delete.
  • route.ts lines 41, 45, 59 still emit source: "live" in the SSE payload but the Venue type no longer has a source field and no consumer reads it. Remove.

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.

3 participants