Skip to content

Commit 5874cb8

Browse files
authored
Merge pull request #19 from BuilderOSS/fix/vercel-deploy
fix: short-circuit empty proposal processing paths
2 parents effa0dc + 222ac2a commit 5874cb8

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "builder-farcaster",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "Tools and automation solutions for Builder DAO on Farcaster, enhancing community efficiency and engagement.",
55
"type": "module",
66
"scripts": {
@@ -87,7 +87,7 @@
8787
},
8888
"packageManager": "pnpm@10.12.1",
8989
"engines": {
90-
"node": ">=20.0.0",
90+
"node": ">=22.0.0",
9191
"pnpm": ">=10.0.0"
9292
}
9393
}

src/commands/process/propdates.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ async function handleProposalUpdates(options: TargetingOptions) {
9999

100100
logger.info({ propdates }, 'New propdates retrieved.')
101101

102+
if (propdates.length === 0) {
103+
logger.info(
104+
'No propdates found after filtering, skipping follower processing.',
105+
)
106+
return
107+
}
108+
102109
const proposalLookup = await buildProposalLookup(
103110
propdates.map((propdate) => ({
104111
chain: propdate.chain,

src/commands/process/proposals.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ export async function processProposalsCommand(options: TargetingOptions = {}) {
196196
matchesProposalTargets(proposal, options),
197197
)
198198

199+
if (filteredProposals.length === 0) {
200+
logger.info(
201+
'No proposals matched targeting filters, terminating execution.',
202+
)
203+
return
204+
}
205+
199206
const currentUnixTimestamp = DateTime.now().toSeconds()
200207
const { endingProposals, votingProposals } = splitProposalBuckets(
201208
filteredProposals,

0 commit comments

Comments
 (0)