Skip to content

Fix Convex push crash and route warnings#120

Merged
Connorbelez merged 2 commits intomainfrom
03-18-bug_squash
Mar 18, 2026
Merged

Fix Convex push crash and route warnings#120
Connorbelez merged 2 commits intomainfrom
03-18-bug_squash

Conversation

@Connorbelez
Copy link
Copy Markdown
Owner

@Connorbelez Connorbelez commented Mar 18, 2026

Summary

  • Remove vitest import from convex/ledger/__tests__/testUtils.ts that crashed the Convex bundler during convex dev push (vitest requires an active test runner at import time)
  • Prefix route component files with - to suppress TanStack Router warnings about non-route files in src/routes/
  • Minor cleanup in seed files and reconciliation

Test plan

  • Run bunx convex dev — should push successfully without the vitest analysis error
  • Verify /demo/governed-transitions pages load without route warnings
  • Run bun run test to confirm ledger tests still pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style

    • Reformatted code expressions for improved readability across multiple files.
  • Chores

    • Refactored component import paths and updated internal type checking patterns.

Copilot AI review requested due to automatic review settings March 18, 2026 07:16
Copy link
Copy Markdown

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Connorbelez has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Copy link
Copy Markdown

@sourcery-ai sourcery-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.

Sorry @Connorbelez, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 18, 2026

Warning

Rate limit exceeded

@Connorbelez has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0bd73918-c9ea-4d4b-8e36-29511e43c56f

📥 Commits

Reviewing files that changed from the base of the PR and between cdd7ca4 and 8b15d98.

📒 Files selected for processing (4)
  • src/routes/demo/governed-transitions/-components/GovernedTransitionsJournalView.tsx
  • src/routes/demo/governed-transitions/-components/GovernedTransitionsMachineView.tsx
  • src/routes/demo/governed-transitions/journal.tsx
  • src/routes/demo/governed-transitions/machine.tsx
📝 Walkthrough

Walkthrough

The PR consolidates formatting changes across multiple files: reformatting multi-line expressions to single lines in reconciliation, seed, and obligation state files. It replaces a test assertion with a runtime type check in testUtils and updates two component import paths to reference dash-prefixed filenames.

Changes

Cohort / File(s) Summary
Reconciliation & Seed Formatting
convex/engine/reconciliation.ts, convex/seed/seedObligation.ts, convex/seed/seedObligationStates.ts
Single-line reformatting of multi-line expressions (collectionAttempt branch, gracePeriodEnd calculation, withIndex call) with no functional changes to behavior or return values.
Test Assertion Refactor
convex/ledger/__tests__/testUtils.ts
Replaced Vitest's expect runtime assertion with a direct instanceof type check in getConvexErrorCode; behavior for valid ConvexError inputs remains unchanged, error-throwing path preserved.
Governed Transitions Import Paths
src/routes/demo/governed-transitions/journal.tsx, src/routes/demo/governed-transitions/machine.tsx
Updated component import paths to reference filenames with dash prefix (-GovernedTransitionsJournalView and -GovernedTransitionsMachineView).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 With whiskers twitched and paws a-dance,
Lines compress in formatting's trance!
Dashes bold in paths now shine,
Type-checks raw where tests align—
Cleaner code in every line! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix Convex push crash and route warnings' directly matches the main objectives: fixing a Convex push crash caused by vitest import and fixing route warnings via file prefixing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 03-18-bug_squash
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the demo “governed transitions” UI by extracting the machine diagram and journal table into dedicated components, while also applying a few small formatting/cleanup tweaks in Convex seed/engine code and ledger test utilities.

Changes:

  • Extracted governed-transitions machine visualization and journal rendering into new _components React components.
  • Updated the governed-transitions route pages to import and use the extracted components.
  • Minor formatting cleanups in seed/engine code and simplified ledger test utils by removing a Vitest-only assertion/import.

Reviewed changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/routes/demo/governed-transitions/machine.tsx Updates route to import the extracted machine view component.
src/routes/demo/governed-transitions/journal.tsx Updates route to import the extracted journal view component.
src/routes/demo/governed-transitions/_components/-GovernedTransitionsMachineView.tsx New component that renders the governed transition state diagram using N8nWorkflowBlock.
src/routes/demo/governed-transitions/_components/-GovernedTransitionsJournalView.tsx New component that renders transition journal entries via InteractiveLogsTable.
convex/seed/seedObligationStates.ts Formatting-only change to index query chaining.
convex/seed/seedObligation.ts Formatting-only change to date helper calls.
convex/ledger/tests/testUtils.ts Removes Vitest expect dependency inside shared test utility function.
convex/engine/reconciliation.ts Formatting-only change to ctx.db.get call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/routes/demo/governed-transitions/machine.tsx Outdated
Comment thread src/routes/demo/governed-transitions/journal.tsx Outdated
Rename _components/ to -components/ following TanStack Router's
convention for excluded directories. Removes the leading hyphen from
individual filenames, addressing the CLI tooling concern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Connorbelez Connorbelez merged commit 1e66f26 into main Mar 18, 2026
1 of 4 checks passed
Connorbelez added a commit that referenced this pull request Apr 20, 2026
## Summary
- Remove `vitest` import from `convex/ledger/__tests__/testUtils.ts` that crashed the Convex bundler during `convex dev` push (vitest requires an active test runner at import time)
- Prefix route component files with `-` to suppress TanStack Router warnings about non-route files in `src/routes/`
- Minor cleanup in seed files and reconciliation

## Test plan
- [ ] Run `bunx convex dev` — should push successfully without the vitest analysis error
- [ ] Verify `/demo/governed-transitions` pages load without route warnings
- [ ] Run `bun run test` to confirm ledger tests still pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Style**
  * Reformatted code expressions for improved readability across multiple files.

* **Chores**
  * Refactored component import paths and updated internal type checking patterns.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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