Skip to content

fix(onboarding): stop calendar list request from crashing and let users skip while it loads - #5

Merged
threos merged 1 commit into
mainfrom
claude/fix-connect-calendar-load-00efq7
Oct 16, 2026
Merged

threos merged 1 commit into
mainfrom
claude/fix-connect-calendar-load-00efq7

Conversation

@threos

@threos threos commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Requested by Eray · project thread

What does this PR do?

Before: the onboarding "Connect your calendar" step sat on skeleton cards for up to a minute, with "Skip for now" and "Continue" disabled the whole time.

After: the calendar providers load straight away, and Skip/Continue work even while the list is still loading.

Root cause, confirmed in production logs on app.tikket.dev: every GET /api/trpc/apps/integrations fails with Invariant: incrementalCache missing in unstable_cache. The query sorts apps by popularity via getInstallCountPerApp, which wrapped the DB call in Next's unstable_cache. That only works inside App Router rendering, but tRPC runs as a Pages Router API route, so it threw on every call. React Query then retried with backoff, which is the long skeleton wait.

How:

  • packages/lib/apps/getInstallCountPerApp.ts: replace unstable_cache with a small in-process cache (same 5 minute TTL, in-flight request shared, failures not cached). This works in both App Router pages (_appRegistry) and API routes, and drops the next/cache import from packages/lib.
  • personal-calendar-view.tsx: Skip and Continue are now gated only on the submit, not on the integrations query.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • TZ=UTC yarn vitest run packages/lib/apps/getInstallCountPerApp.test.ts (new: mapping, cache hit, TTL expiry, failures not cached).
  • Sign up a new user and reach /onboarding/personal/calendar: provider cards should appear immediately, and Skip should be clickable from the start. /api/trpc/apps/integrations should return 200.

🤖 Generated with Claude Code

https://claude.ai/code/session_019VUFQx2U3zsKWTjCG8J6p9


Generated by Claude Code

…allow skipping while it loads

getInstallCountPerApp used Next's unstable_cache, which throws
"incrementalCache missing" when called from the Pages Router tRPC route
(apps.integrations). The query failed and React Query retried it, leaving the
onboarding calendar step on skeletons with Skip/Continue disabled. Replace it
with an in-process TTL cache, and stop gating Skip/Continue on the list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019VUFQx2U3zsKWTjCG8J6p9
@threos threos self-assigned this Oct 16, 2026
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tikket-dev Ready Ready Preview Oct 16, 2026 2:59pm UTC

Request Review

@threos
threos marked this pull request as ready for review October 16, 2026 16:35
@threos
threos merged commit 54fed95 into main Oct 16, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 2c21f3f3 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants