Skip to content

Conversation

panteliselef
Copy link
Member

@panteliselef panteliselef commented Sep 2, 2025

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • Tests

    • Improved reliability of checkout and pricing flows by adding explicit waits and extending timeouts, reducing flakiness and intermittent failures.
  • Chores

    • Added a changeset metadata file to support release management (no user-facing impact).

@panteliselef panteliselef requested a review from a team September 2, 2025 10:33
@panteliselef panteliselef self-assigned this Sep 2, 2025
Copy link

changeset-bot bot commented Sep 2, 2025

🦋 Changeset detected

Latest commit: 5eeac89

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Walkthrough

Adds a changeset metadata file and updates a pricing table integration test to increase UI timeouts, add explicit checkout progression steps, and wait for navigation to the root URL before continuing test steps.

Changes

Cohort / File(s) Summary
Changeset metadata
\.changeset/chilly-kids-fly.md
Added empty changeset front matter (--- / ---); no code or API impact.
Integration tests — checkout flow stabilization
integration/tests/pricing-table.test.ts
Increased ToBeVisible timeouts to 15s for key messages; added checkout.confirmAndContinue() after pay/subscribe actions; inserted page.waitForAppUrl('/') post-checkout; reordered steps to wait for navigation before proceeding to profile.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Tester as Test Runner
  participant Page as Browser Page
  participant App as App (UI)
  participant Pay as Checkout Service

  Tester->>Page: Trigger checkout (Pay/Subscribe)
  Page->>Pay: Submit payment
  Pay-->>Page: Payment success
  Page->>App: checkout.confirmAndContinue()
  Note over Page,App: New explicit step to advance flow
  Page->>App: Wait for navigation to '/'
  Note over Page,App: page.waitForAppUrl('/')
  Page->>App: Wait for "Trial started" / "Payment was successful!" (15s)
  Note over Tester,Page: Increased visibility timeouts
  Tester->>Page: Navigate to Profile page (after root reached)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws—tests march in line,
Longer waits, smooth flows—oh my, how fine!
Hop to root, then profile view,
Confirm and continue—we’re nearly through.
Flakes be gone, the carrots shine,
Checkout’s steady—ship on time! 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch elef/flaky-billing-e2es

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

vercel bot commented Sep 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Sep 2, 2025 10:35am

Copy link

pkg-pr-new bot commented Sep 2, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6681

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6681

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6681

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6681

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6681

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6681

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6681

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6681

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6681

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6681

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6681

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6681

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6681

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6681

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6681

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6681

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6681

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6681

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6681

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6681

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6681

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6681

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6681

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6681

commit: 5eeac89

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
integration/tests/pricing-table.test.ts (2)

424-424: Standardize wait helper usage (u.page vs u.po.page).

Elsewhere in this file you use u.page.waitForAppUrl, here it’s u.po.page.waitForAppUrl. Pick one for consistency; suggest aligning to u.page like the other occurrences.

-      await u.po.page.waitForAppUrl('/');
+      await u.page.waitForAppUrl('/');

489-491: Extend success-toast timeout and scope to checkout root for consistency.

Consider scoping like line 623 and centralizing the 15_000 timeout in a shared constant to keep assertions uniform.

-      await expect(u.po.page.getByText('Payment was successful!')).toBeVisible({
+      await expect(u.po.checkout.root.getByText('Payment was successful!')).toBeVisible({
         timeout: 15_000,
       });

Also consider applying the same timeout/scoping to other success checks (e.g., Lines 168, 536, 645).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a50cfc8 and 5eeac89.

📒 Files selected for processing (2)
  • .changeset/chilly-kids-fly.md (1 hunks)
  • integration/tests/pricing-table.test.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/chilly-kids-fly.md
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • integration/tests/pricing-table.test.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • integration/tests/pricing-table.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • integration/tests/pricing-table.test.ts
integration/**

📄 CodeRabbit inference engine (.cursor/rules/global.mdc)

Framework integration templates and E2E tests should be placed under the integration/ directory

Files:

  • integration/tests/pricing-table.test.ts
integration/**/*

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

End-to-end tests and integration templates must be located in the 'integration/' directory.

Files:

  • integration/tests/pricing-table.test.ts
integration/**/*.{test,spec}.{js,ts}

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

Integration tests should use Playwright.

Files:

  • integration/tests/pricing-table.test.ts
**/*.{js,ts,tsx,jsx}

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

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • integration/tests/pricing-table.test.ts
🪛 LanguageTool
.changeset/chilly-kids-fly.md

[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---

(QB_NEW_DE)

⏰ 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). (5)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
integration/tests/pricing-table.test.ts (2)

294-296: Good call increasing timeout for the trial-start toast.

This should reduce flakiness around delayed webhook/processing.


446-448: Confirm-and-continue + wait for app URL is the right sequencing.

This addresses races between checkout completion and route change.

Comment on lines +1 to +2
---
---
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Empty changeset front matter is invalid and will fail Changesets parsing/CI.

Either remove the file (test-only PR; no release) or replace with a valid changeset targeting the correct package(s) and bump type. If a changeset is required but no release should occur, follow the repo’s “no release” policy (e.g., label-based skip or a “none” bump if supported by your setup). Please confirm project policy.


🏁 Script executed:

#!/bin/bash
ls -la .changeset

Length of output: 1676


Fix or remove empty changeset front matter
File “.changeset/chilly-kids-fly.md” contains only empty front matter (---\n---), which will break Changesets. Either delete this file if no release is intended, or fill in a valid front matter with the appropriate package(s) and bump type. If you need a no-release changeset, apply the repo’s “no release” policy (e.g. a “none” bump or label-based skip).

🧰 Tools
🪛 LanguageTool

[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---

(QB_NEW_DE)

🤖 Prompt for AI Agents
In .changeset/chilly-kids-fly.md lines 1-2 there is only empty front matter
(---\n---) which will break Changesets; fix it by either deleting this file if
no release is intended, or replace the empty front matter with valid changeset
front matter listing the affected package(s) and a bump type (major/minor/patch
or your repo’s “none”/no-release convention), or apply the repository’s
no-release policy (e.g., use a “none” bump or add the required label) so
Changesets can process it correctly.

@panteliselef panteliselef enabled auto-merge (squash) September 2, 2025 11:27
@panteliselef panteliselef merged commit e9f538a into main Sep 2, 2025
64 of 65 checks passed
@panteliselef panteliselef deleted the elef/flaky-billing-e2es branch September 2, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants