course-builder icon indicating copy to clipboard operation
course-builder copied to clipboard

joel/inngest realtime

Open joelhooks opened this issue 1 month ago • 4 comments

  • start inngest realtime spike
  • enable realtime

Summary by CodeRabbit

  • New Features
    • Opt-in real-time video upload and live status updates (enabled via a new public feature flag).
    • Client subscriptions for video status with automatic UI refresh on video/transcript events.
  • Improvements
    • Dual-path delivery: realtime publish with graceful fallback to existing broadcast for reliability.
  • Documentation
    • Added migration plan for moving to the realtime approach.
  • Chores
    • Prepared patch releases and updated configuration and related packages across apps.

joelhooks avatar Oct 11 '25 17:10 joelhooks

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
ai-hero Ready Ready Preview Comment Oct 15, 2025 2:44pm
code-with-antonio Error Error Oct 15, 2025 2:44pm
course-builder-egghead Ready Ready Preview Comment Oct 15, 2025 2:44pm
epic-react-builder Ready Ready Preview Comment Oct 15, 2025 2:44pm
epic-web-builder Ready Ready Preview Comment Oct 15, 2025 2:44pm
epicai-pro Ready Ready Preview Comment Oct 15, 2025 2:44pm

vercel[bot] avatar Oct 11 '25 17:10 vercel[bot]

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds Inngest Realtime support and feature-flagged realtime video events across server and client: middleware wiring, a realtime channel schema, conditional publish paths in core video handlers, client subscription hooks and token action, removal of PartyKit onConnect logic, and dependency bumps (inngest and @inngest/realtime). Adds planning doc and changesets.

Changes

Cohort / File(s) Summary
Changesets & Config
/.changeset/config.json, /.changeset/purple-doors-attend.md
Updated changeset config ignore list to include code-with-antonio. Added new changeset documenting patch releases and note "add inngest realtime".
Env flag for realtime
apps/code-with-antonio/.env.development
Adds NEXT_PUBLIC_ENABLE_REALTIME_VIDEO_UPLOAD="true" development feature flag.
Client realtime integration (code-with-antonio)
apps/code-with-antonio/src/app/(content)/posts/_components/standalone-video-resource-uploader-and-viewer.tsx, apps/code-with-antonio/src/components/content/content-video-resource-field.tsx, apps/code-with-antonio/src/components/party.tsx, apps/code-with-antonio/src/hooks/use-video-realtime.ts, apps/code-with-antonio/src/app/actions/realtime.ts
Replaces socket/onMessage flows with useVideoRealtimeSubscription; adds server action fetchRealtimeVideoToken; subscription uses videoChannel(...).status; components react to subscription.latestData; gated by env flag.
Party server pruning
apps/code-with-antonio/party/index.ts
Removed onConnect and PartyKit/Yjs document loading and snapshot/persist logic; retained message storage and HTTP handling.
Inngest middleware wiring
apps/code-with-antonio/src/inngest/inngest.server.ts, packages/core/src/inngest/create-inngest-middleware.ts
Import and add realtimeMiddleware() to Inngest initialization/middleware stack.
Core video-processing: conditional realtime publish
packages/core/src/inngest/video-processing/functions/video-uploaded.ts, .../video-ready.ts, .../video-processing-error.ts, .../transcript-ready.ts, .../generate-transcript-with-screnshots.ts
Handlers extended to accept publish; build unified payloads and either publish(videoChannel(roomId).status(...)) when realtime enabled/publish available or fallback to partyProvider.broadcastMessage.
Realtime channel schema
packages/core/src/inngest/video-processing/realtime.ts
Adds videoChannel with status topic and Zod-validated payload schema; exports VideoStatusPayload type.
Dependency updates: inngest
apps/*/package.json (ai-hero, astro-party, course-builder-web, craft-of-ui, cursor-pro, egghead, epic-react, epic-web, epicdev-ai, go-local-first), cli/template-app-with-posts/package.json, packages/next/package.json, apps/code-with-antonio/package.json, packages/core/package.json
Bumps inngest from 3.35.0 to 3.44.2 across many apps/packages; adds @inngest/realtime to apps/code-with-antonio and packages/core.
Planning doc
/plans/partykit-to-inngest-realtime.md
Adds migration plan for moving from PartyKit to Inngest realtime with bootstrap, middleware, handler adaptation, client subscription, env/flag scaffolding, testing, rollout, and rollback notes.
Markdown rendering tweak
apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx
Replaced plain paragraph with ReactMarkdown for workshop description rendering.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User (Browser)
  participant C as React Component
  participant H as useVideoRealtimeSubscription
  participant SA as fetchRealtimeVideoToken (server)
  participant RT as Inngest Realtime
  participant IF as Inngest Function(s)

  Note over C,U: Flag: NEXT_PUBLIC_ENABLE_REALTIME_VIDEO_UPLOAD=true
  U->>C: Load page (video resource)
  C->>H: Init subscription (roomId, enabled)
  H->>SA: Request token for roomId
  SA->>RT: getSubscriptionToken(videoChannel(roomId), topics:['status'])
  RT-->>SA: Token
  SA-->>H: Token
  H->>RT: Subscribe to channel topic: status
  par Processing
    IF->>RT: publish(videoChannel(roomId).status(payload))
  and Fallback
    IF->>C: partyProvider.broadcastMessage(payload) (when realtime disabled/unavailable)
  end
  RT-->>H: status event (payload)
  H-->>C: latestData update
  C->>C: React effect handles payload (refetch/refresh/update)
sequenceDiagram
  autonumber
  participant IF as Inngest Function
  participant RM as realtimeMiddleware
  participant PUB as publish
  participant RT as Inngest Realtime

  IF->>RM: Handler invoked with context
  RM-->>IF: Injects publish()
  IF->>IF: Build payload {name, body, requestId}
  alt realtimeEnabled && publish
    IF->>PUB: videoChannel(roomId).status(payload)
    PUB->>RT: send
  else
    IF->>IF: partyProvider.broadcastMessage(payload)
  end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • badass-courses/course-builder#566 — Edits same workshops page (markdown rendering); UI-related overlap with apps/ai-hero/src/.../page.tsx.

Suggested reviewers

  • vojtaholik
  • nicollguarnizo

Poem

"I’m a rabbit on the realtime track,
Hopping tokens, sending back.
Channels bloom and payloads sing,
Flags flipped up—new updates spring.
Sniff, thump, deploy—let messages pack!" 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title “joel/inngest realtime” references the addition of Inngest realtime functionality, which aligns with the primary change set enabling realtime behavior across the repo. Although the “joel/” prefix is branch-style noise and the phrase could be more polished, it does point to the main change of integrating realtime via Inngest.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch joel/inngest-realtime

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4676436d10d8c44f176f396c0b76ad6bbff962ef and e172dd6c1ed9ed8a5a72c685a50cd221fad0f7c1.

📒 Files selected for processing (1)
  • apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Add JS Doc comments to functions and React components

Files:

  • apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,jsx}: Use single quotes, no semicolons, tabs (width: 2), and an 80 character line limit for code formatting. Organize imports in the following order: React → Next → 3rd party → internal. Do NOT use Object.defineProperty(exports, ...) for re-exports. Use standard export patterns instead to avoid conflicts with framework internals.

Files:

  • apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx
apps/**/*

📄 CodeRabbit inference engine (.cursor/rules/monorepo-setup.mdc)

Apps are located in the /apps directory

Files:

  • apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx
apps/ai-hero/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/ai-hero/.cursor/rules/analytics.mdc)

apps/ai-hero/**/*.{ts,tsx}: The track function in @/utils/analytics.ts is ONLY for tracking learner/customer activity (such as course progress, video watching, exercise completion, purchase activity, and user preferences). Do NOT use track for internal admin actions, content management, system operations, or backend processes. Use log from @/server/logger.ts for system operations, content management, error tracking, performance monitoring, and backend processes. Always include relevant IDs and context in log messages.

Always use kebab-case when naming files

Add JSDoc comments to exported methods and React components in TypeScript files

Files:

  • apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx
apps/ai-hero/**/*.tsx

📄 CodeRabbit inference engine (apps/ai-hero/.cursor/rules/component-system.mdc)

Use base React components from the /packages/ui package when possible

Files:

  • apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: typecheck
  • GitHub Check: format
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: e2e-node (course-builder-web)
🔇 Additional comments (2)
apps/ai-hero/src/app/(content)/workshops/[module]/page.tsx (2)

32-32: LGTM! Import correctly positioned.

The ReactMarkdown import follows the project's import organization guidelines (React → Next → 3rd party → internal).


227-231: Verify workshop descriptions render correctly

Switching to ReactMarkdown (default settings: escapes HTML, parses markdown) may alter how existing descriptions display. Ensure that:

  • No descriptions rely on raw HTML tags (they’ll now render as text)
  • Literal markdown characters (*, _, #, etc.) won’t cause unintended formatting
  • All descriptions have been reviewed or migrated to valid Markdown in the database

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Oct 11 '25 17:10 coderabbitai[bot]

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​inngest/​realtime@​0.4.4981007298100
Updatedinngest@​3.35.0 ⏵ 3.44.29710010099100

View full report

socket-security[bot] avatar Oct 11 '25 17:10 socket-security[bot]

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

socket-security[bot] avatar Oct 11 '25 17:10 socket-security[bot]