farcasterxyz / hub-monorepo

Implementation of the Farcaster Hub specification and supporting libraries for building applications on Farcaster
https://www.thehubble.xyz
MIT License
700 stars 392 forks source link

fix: add request length limit for getAllMessagesBySyncIds #2347

Closed aditiharini closed 16 hours ago

aditiharini commented 17 hours ago

We've observed hub memory usage and disk reads spike over the last couple days. We'd like to put a size bound on getAllMessagesBySyncIds because it currently accepts an unlimited number of sync ids and could end up exhausting hub resources.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review


PR-Codex overview

This PR focuses on adding a request length limit for the getAllMessagesBySyncIds function in the server.ts file and refactoring the message retrieval logic in syncHealth.ts to handle multiple requests efficiently.

Detailed summary

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

changeset-bot[bot] commented 17 hours ago

🦋 Changeset detected

Latest commit: 21b3ffcebd78df9233a587973b0328cbe5a32505

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | @farcaster/hubble | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 17 hours ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hub-monorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 2, 2024 3:21pm