Aditi Srinivasan 41b1f35466 fix: only maintain counts for expected events in event stream monitoring (#2612)
## Why is this change needed?

We're producing a lot of errors with 0 missing events due to this bug. 

## 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 event stream monitoring by ensuring that
only counts for expected events are maintained, thereby optimizing the
handling of event data.

### Detailed summary
- Modified the `setBlockCounts` method in the `eventStream.ts` file.
- Changed the way event counts are retrieved: now checks if the count is
`undefined` before setting it in Redis.
- Removed the default count of `0`, ensuring only relevant counts are
stored.

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

<!-- end pr-codex -->
2025-06-25 18:59:26 -04:00
2024-07-11 10:01:03 -07:00
2025-01-27 13:52:57 -08:00

Hub Monorepo

This monorepo contains packages used to communicate with a Farcaster Hub.

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.

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
Description
No description provided
Readme MIT 53 MiB
Languages
TypeScript 91.7%
Rust 8.1%
Go 0.1%