feat(workers): reconstruct scheduled-cast senders (gated off) - #12
Merged
Merged
Conversation
Rebuild the two scheduled-send workers that were stubbed out of the fork: - src/scripts/sendScheduledDrafts.ts: sends due Drafts (sendStatus=SCHEDULED, nextScheduledAt<=now) via existing @/utils/drafts sendDraftToFarcaster, which handles recurring reschedule + scheduled reactions + error states. - src/scripts/sendScheduledCasts.ts: sends due ScheduledCast rows (status=PENDING, scheduledAt<=now) directly via the Neynar client, with idempotency keys. Standalone casts only; thread-grouped casts are a follow-up. Both routes keep the CRON_SECRET guard and are gated behind CASTORA_ENABLE_SCHEDULED_SENDER (off by default) AND are NOT in vercel.json crons, so they are fully inert until deliberately enabled. typecheck passes; routes compile and 401 without auth. End-to-end posting intentionally untested (would post real casts) — verify on a test account before enabling. No changelog entry yet: not user-facing until turned on.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebuilds the two scheduled-send workers that were stubbed out of the fork, fully inert until deliberately enabled.
src/scripts/sendScheduledDrafts.ts— sends due Drafts (sendStatus=SCHEDULED,nextScheduledAt<=now) via the existing@/utils/draftssendDraftToFarcaster, which already handles recurring reschedule, scheduled reactions, and error states.src/scripts/sendScheduledCasts.ts— sends due ScheduledCast rows (status=PENDING,scheduledAt<=now) via the Neynar client with idempotency keys. Standalone casts only; thread-grouped casts are a documented follow-up.Safety
CRON_SECRETguard and are gated behindCASTORA_ENABLE_SCHEDULED_SENDER(off by default) and are not invercel.jsoncrons → they post nothing until you set the flag and add a cron. Merging is inert.Verification
npm run typecheckpasses; both routes compile and return401without auth.To enable later
Set
CASTORA_ENABLE_SCHEDULED_SENDER=truein Vercel and add cron entries (e.g.*/5 * * * *) tovercel.json.