Skip to content

Commit f1f2b4c

Browse files
authored
chore: upgrade shuttle dependency for example app (#2653)
## Why is this change needed? The example app was fixed at an old version of shuttle that was missing more recent updates including storage lending. ## 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 upgrading the `@farcaster/shuttle` dependency in the example app and making related adjustments in the codebase, including changes to request handling and variable names. ### Detailed summary - Updated `@farcaster/shuttle` dependency from `^0.5.0` to `^0.9.3`. - Replaced `HubInfoRequest` with `GetInfoRequest` in the `App` class. - Changed handling of `undefined` instead of `null` for the `hubSubscriber` initialization. - Modified the retrieval of `maxFid` to use `numFidRegistrations` instead of `numFidEvents`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 872a38b commit f1f2b4c

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.changeset/short-berries-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@farcaster/shuttle": patch
3+
---
4+
5+
chore: upgrade the example app's shuttle dependency

packages/shuttle/src/example-app/app.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
getStorageUnitExpiry,
2020
getStorageUnitType,
2121
HubEvent,
22-
HubInfoRequest,
22+
GetInfoRequest,
2323
isCastAddMessage,
2424
isCastRemoveMessage,
2525
isIdRegisterOnChainEvent,
@@ -95,13 +95,12 @@ export class App implements MessageHandler {
9595
const hubSubscriber = new EventStreamHubSubscriber(
9696
hubId,
9797
hub,
98+
shardIndex,
9899
eventStreamForWrite,
99100
redis,
100101
shardKey,
101102
log,
102-
null,
103-
totalShards,
104-
shardIndex,
103+
undefined,
105104
SUBSCRIBE_RPC_TIMEOUT,
106105
);
107106
const streamConsumer = new HubEventStreamConsumer(hub, eventStreamForRead, shardKey);
@@ -223,7 +222,6 @@ export class App implements MessageHandler {
223222
this.db,
224223
log,
225224
undefined,
226-
USE_STREAMING_RPCS_FOR_BACKFILL,
227225
);
228226
for (const fid of fids) {
229227
await reconciler.reconcileMessagesForFid(
@@ -250,12 +248,12 @@ export class App implements MessageHandler {
250248
if (fids.length === 0) {
251249
let maxFid = MAX_FID ? parseInt(MAX_FID) : undefined;
252250
if (!maxFid) {
253-
const getInfoResult = await this.hubSubscriber.hubClient?.getInfo(HubInfoRequest.create({}));
251+
const getInfoResult = await this.hubSubscriber.hubClient?.getInfo(GetInfoRequest.create({}));
254252
if (getInfoResult?.isErr()) {
255253
log.error("Failed to get max fid", getInfoResult.error);
256254
throw getInfoResult.error;
257255
} else {
258-
maxFid = getInfoResult?._unsafeUnwrap()?.dbStats?.numFidEvents;
256+
maxFid = getInfoResult?._unsafeUnwrap()?.dbStats?.numFidRegistrations;
259257
if (!maxFid) {
260258
log.error("Failed to get max fid");
261259
throw new Error("Failed to get max fid");

packages/shuttle/src/example-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"main": "./app.ts",
55
"license": "MIT",
66
"dependencies": {
7-
"@farcaster/shuttle": "^0.5.0",
7+
"@farcaster/shuttle": "^0.9.3",
88
"@figma/hot-shots": "^9.0.0-figma.1",
99
"commander": "^11.0.0",
1010
"ioredis": "^5.3.2",

0 commit comments

Comments
 (0)