mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-01-10 05:38:07 -05:00
07aaf852ec455a79af331c602413157b83cb1902
## Why is this change needed?
In cases like this, we're not falling back to the RPC
```
{"jobName":"reconcile","jobId":"9273216","reason":"Unable to get all casts for FID 652934: server timeout","errorName":"Error","errorMessage":"Unable to get all casts for FID 652934: server timeout","errorStack":"Error: Unable to get all casts for FID 652934: server timeout\n at
MessageReconciliation.getAllCastMessagesByFidInBatchesOf (file:///app/node_modules/@farcaster/shuttle/dist/index.mjs:1060:15)\n at runNextTicks (node:internal/process/task_queues:60:5)\n at process.processTimers (node:internal/timers:511:9)\n at async MessageReconciliation.allHubMessagesOfTypeForFid (file:///app/node_modules/@farcaster/shuttle/dist/index.mjs:980:22)\n at async MessageReconciliation.reconcileMessagesOfTypeForFid (file:///app/node_modules/@farcaster/shuttle/dist/index.mjs:918:22)\n at async MessageReconciliation.reconcileMessagesForFid (file:///app/node_modules/@farcaster/shuttle/dist/index.mjs:913:7)\n at App.reconcileFids (/app/src/shuttle.ts:132:13)\n at Worker.Worker.autorun (/app/src/worker.ts:21:9)\n at Worker.processJob (/app/node_modules/bullmq/src/classes/worker.ts:776:22)\n at Worker.retryIfFailed (/app/node_modules/bullmq/src/classes/worker.ts:982:16)"}
```
## Merge Checklist
_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_
- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on improving error handling in the `reconcile` process
by enhancing the fallback mechanism to RPC in more scenarios when stream
errors occur, and temporarily skipping a test for unresponsive server
requests.
### Detailed summary
- Updated the `shuttle.integration.test.ts` file to skip the test for
unresponsive server requests.
- Enhanced the `messageReconciliation.ts` file to log a warning when a
stream fetch times out and fall back to RPC.
- Added a cancellation mechanism to prevent hanging connections.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`
<!-- end pr-codex -->
Hubble Monorepo
This monorepo contains Hubble, a Farcaster Hub implementation, and other packages used to communicate with Hubble.
Getting Started
See CONTRIBUTING.md to set up your developer environment and learn about how to contribute.
Code Organization
The repository is a monorepo with a primary application in the /apps/ folder that imports several packages /packages/. It is written primarily in Typescript and uses Yarn to orchestrate tasks and TurboRepo as its build system. Some performance intensive code is written in Rust and compiled with Cargo.
Applications
| App Name | Description |
|---|---|
| @farcaster/hubble | A Farcaster Hub implementation |
To run Hubble, please see the Hubble docs.
Packages
| Package Name | Description |
|---|---|
| @farcaster/shuttle | A package that streams Hubble events to Postgres |
| @farcaster/hub-nodejs | A Node.js client library for Hubble |
| @farcaster/hub-web | A Browser client library for Hubble |
| @farcaster/core | Shared code between all packages |
Languages
TypeScript
91.7%
Rust
8.1%
Go
0.1%