Skip to content

fix: revert page-level hooks to useRealtimeRun to fix auth context error#2780

Merged
Marfuen merged 1 commit intomainfrom
mariano/onboarding-perf-followup
May 7, 2026
Merged

fix: revert page-level hooks to useRealtimeRun to fix auth context error#2780
Marfuen merged 1 commit intomainfrom
mariano/onboarding-perf-followup

Conversation

@Marfuen
Copy link
Copy Markdown
Contributor

@Marfuen Marfuen commented May 7, 2026

Summary

Fixes the "Missing accessToken in TriggerAuthContext" error on staging that crashes the overview and policies pages.

  • useRun requires a TriggerProvider context with an access token
  • When there's no active onboarding (no triggerJobId), the TriggerTokenProvider renders children WITHOUT a TriggerProvider
  • useRun throws; useRealtimeRun with enabled: false gracefully returns null

Changes:

  • policies-table.tsx: useRunuseRealtimeRun with enabled flag
  • use-policy-onboarding-status.ts: same
  • use-onboarding-status.ts: same (covers both risks and vendors)
  • ToDoOverview.tsx: removed trigger hook entirely — derives isOnboardingInProgress from the triggerJobId prop

Follow-up to #2777.

Test plan

  • Overview page loads without error when no onboarding is active
  • Policies page loads without error when no onboarding is active
  • Typecheck passes

🤖 Generated with Claude Code


Summary by cubic

Fixes the “Missing accessToken in TriggerAuthContext” crash by reverting page-level hooks to useRealtimeRun and removing an unnecessary trigger hook. Overview and Policies now load safely when no onboarding is active.

  • Bug Fixes
    • Replaced useRun with useRealtimeRun({ enabled }) from @trigger.dev/react-hooks in policies table and onboarding status hooks to avoid requiring a TriggerProvider when no onboardingRunId.
    • Simplified ToDoOverview: removed trigger hook and derive isOnboardingInProgress from triggerJobId.
    • Prevents crashes on Overview and Policies when onboarding isn’t running.

Written for commit a24baec. Summary will update on new commits.

…ntext

useRun requires a TriggerProvider with an access token. When there's no
active onboarding (no triggerJobId), the TriggerTokenProvider renders
children without a TriggerProvider, causing useRun to throw "Missing
accessToken in TriggerAuthContext."

Reverted policies-table, use-policy-onboarding-status, and
use-onboarding-status back to useRealtimeRun which gracefully handles
missing auth context via the enabled flag.

For ToDoOverview, removed the trigger hook entirely — it only needs
a boolean "is onboarding running" which can be derived from the
triggerJobId prop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

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

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment May 7, 2026 0:41am
comp-framework-editor Ready Ready Preview, Comment May 7, 2026 0:41am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped May 7, 2026 0:41am

Request Review

@vercel vercel Bot temporarily deployed to Preview – portal May 7, 2026 12:36 Inactive
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@Marfuen Marfuen merged commit 5a406f9 into main May 7, 2026
10 checks passed
@Marfuen Marfuen deleted the mariano/onboarding-perf-followup branch May 7, 2026 12:47
claudfuen pushed a commit that referenced this pull request May 7, 2026
# [3.45.0](v3.44.2...v3.45.0) (2026-05-07)

### Bug Fixes

* address cubic review findings on onboarding PR ([#2783](#2783)) ([bd43e8a](bd43e8a))
* **onboarding:** handle zero-item steps in tracker ([#2785](#2785)) ([a196339](a196339))
* revert page-level hooks to useRealtimeRun to fix missing auth context ([#2780](#2780)) ([5a406f9](5a406f9))

### Features

* **frameworks:** remove is-framework-versioning-enabled feature flag ([#2781](#2781)) ([016f379](016f379))

### Performance Improvements

* **build:** skip TS in next build, reduce sentry upload, add CI typecheck ([#2782](#2782)) ([26e1667](26e1667))
* **onboarding:** optimize onboarding pipeline from ~5min to ~2min ([b14db0b](b14db0b))
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.45.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants