Skip to content

feat: preload feed on home page - #55

Open
howwee20 wants to merge 3 commits into
mainfrom
codex/pre-populate-video-feed-on-load
Open

feat: preload feed on home page#55
howwee20 wants to merge 3 commits into
mainfrom
codex/pre-populate-video-feed-on-load

Conversation

@howwee20

Copy link
Copy Markdown
Owner

Summary

  • convert the home page into a server component that preloads results via a new feed helper
  • add a feed utility that reads BLOOM_DEFAULT_FEED and calls the existing search logic to fetch initial results
  • update the search API to handle batched queries and surface enough hydrated results for the default feed
  • adjust the client home component to consume the initial feed, keep grid markup intact, and surface twelve cards in feed mode

Testing

  • npm run lint (fails: missing @eslint/eslintrc dependency; npm install blocked with 403 from registry)

https://chatgpt.com/codex/tasks/task_e_68cb072fc3548333960799de4bbf6c4c

@vercel

vercel Bot commented Sep 17, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
bloom Ready Ready Preview Comment Sep 17, 2025 7:44pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread src/lib/feed.ts
Comment on lines +39 to +45
try {
const request = new Request("https://bloom.local/api/search", {
method: "POST",
headers: {
"content-type": "application/json",
"x-forwarded-for": "server-internal",
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Server preload trips global rate limit

The new server-side fetchInitialFeed calls the search API with a hard-coded x-forwarded-for header of "server-internal". The rate limiter in src/app/api/_ratelimit.ts buckets requests by this header value and allows only 10 requests per 60 seconds. Because every SSR of the home page now uses the same header, the shared bucket will be exhausted after a handful of page loads, after which all users will see degraded or empty feeds until the window resets. This effectively rate-limits the entire site rather than per client IP.

Useful? React with 👍 / 👎.

@vercel

vercel Bot commented Sep 17, 2025

Copy link
Copy Markdown

Someone is attempting to deploy this pull request to the howwee20's projects Team on Vercel.

To accomplish this, the commit author's email address needs to be associated with a GitHub account.

Learn more about how to change the commit author information.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant