Skip to content

Conversation

@NathanFlurry
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Nov 9, 2025

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

Project Deployment Preview Comments Updated (UTC)
rivetkit-serverless Ready Ready Preview Comment Nov 13, 2025 1:32am
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rivet-cloud Ignored Ignored Nov 13, 2025 1:32am
rivet-inspector Ignored Ignored Preview Nov 13, 2025 1:32am
rivet-site Ignored Ignored Preview Nov 13, 2025 1:32am

Copy link
Member Author

NathanFlurry commented Nov 9, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Nov 9, 2025

Code Review: Rename onFetch to onRequest

Overall, this is a clean refactoring that improves naming clarity. The rename from onFetch to onRequest is semantically better since the handler deals with raw HTTP requests, not just fetch operations.

Critical Issue Found

🐛 Typo in Error Class Name (rivetkit-typescript/packages/rivetkit/src/actor/errors.ts:320)

There's a typo in the renamed error class:

export class RequestHandlerNotDfeined extends ActorError {

Should be:

export class RequestHandlerNotDefined extends ActorError {

Impact: This typo will cause a runtime error when the error is thrown, since it's referenced correctly as RequestHandlerNotDfeined in src/actor/instance/mod.ts:653, but the class name itself contains a typo ("Dfeined" instead of "Defined").

Positive Observations

Comprehensive rename: All references have been consistently updated across:

  • Actor configuration and types
  • Error classes and messages
  • Method names (handleFetchhandleRawRequest)
  • Test fixtures and test cases
  • Comments and documentation strings

State field renaming: Good attention to detail renaming onFetchRequest to onRequestRequest in the request-access fixture

Consistent error messages: Error messages have been updated to reflect the new naming (e.g., "Actor must implement onRequest")

Type safety maintained: All TypeScript types and interfaces updated correctly

Minor Observations

  • The WebSocket handler was also renamed from handleWebSocket to handleRawWebSocket for consistency, which is good for clarity
  • All test descriptions updated appropriately
  • Comments in code updated to reflect new naming

Recommendation

Action Required: Fix the typo in the error class name before merging. Otherwise, this PR is good to merge.

Testing

Consider running the driver test suite to ensure the error handling still works correctly after fixing the typo:

# Run driver tests for raw HTTP functionality
cargo test -p rivetkit raw_http

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 9, 2025

More templates

@rivetkit/actor

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/actor@3424

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@3424

@rivetkit/core

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/core@3424

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@3424

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@3424

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@3424

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@3424

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@3424

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@3424

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@3424

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@3424

commit: 5bf1455

@NathanFlurry NathanFlurry changed the base branch from graphite-base/3424 to 11-09-refactor_rivetkit_add_state_manager_for_conn_with_symbol-based_access November 10, 2025 22:03
@jog1t jog1t force-pushed the 11-09-refactor_rivetkit_add_state_manager_for_conn_with_symbol-based_access branch from eb167b2 to b6878b5 Compare November 12, 2025 17:06
@jog1t jog1t force-pushed the 11-09-chore_rivetkit_rename_onfetch_to_onrequest_ branch from 916b548 to 5bab9a4 Compare November 12, 2025 17:06
@claude
Copy link

claude bot commented Nov 12, 2025

PR Review: Rename onFetch to onRequest

Issues Found

🔴 CRITICAL: Typo in Error Class Name

Location: rivetkit-typescript/packages/rivetkit/src/actor/errors.ts:320

export class RequestHandlerNotDfeined extends ActorError {

Issue: Class name has a typo - should be RequestHandlerNotDefined (missing 'e' in "Defined")

Fix: Rename the class to RequestHandlerNotDefined


🟡 Minor: Stale Comment Reference

Location: rivetkit-typescript/packages/rivetkit/src/actor/router.ts:202

// This should never happen now since handleFetch throws errors

Issue: Comment still references old method name handleFetch

Fix: Update to: // This should never happen now since handleRawRequest throws errors


Positive Observations

Comprehensive rename across config types, implementations, tests, and documentation
Consistent error code updates (e.g., "fetch_not_defined" → "request_not_defined")
Improved method naming symmetry with handleRawRequest and handleRawWebSocket
Thorough test fixture updates including state property renames
Good test coverage for this refactoring

Recommendations

  1. Fix the critical typo in the error class name
  2. Update the stale comment reference
  3. Since this is a breaking API change, consider documenting it in a changelog or migration guide

Overall this is a clean refactoring with clear intent, just needs the typo fixed before merging.

@claude
Copy link

claude bot commented Nov 12, 2025

PR Review: Rename onFetch to onRequest

Summary

This PR performs a straightforward refactoring to rename onFetch to onRequest throughout the RivetKit TypeScript codebase. The change affects 14 files with 54 additions and 45 deletions.

Critical Issue Found 🚨

Typo in class name (src/actor/errors.ts:320):

export class RequestHandlerNotDfeined extends ActorError {

Should be:

export class RequestHandlerNotDefined extends ActorError {

Impact: This typo appears in two locations:

  • src/actor/errors.ts:320 - Class definition
  • src/actor/instance/mod.ts:653 - Usage: throw new errors.RequestHandlerNotDfeined();

Both must be fixed to correct the spelling from "Dfeined" to "Defined".


Code Quality Assessment

Strengths:

  • ✅ Consistent renaming across the entire codebase
  • ✅ Updated all test fixtures and test cases
  • ✅ Updated comments and documentation strings
  • ✅ Maintained existing functionality - purely a naming change
  • ✅ Updated state property names (onFetchRequestonRequestRequest)
  • ✅ Updated internal method names (handleFetchhandleRawRequest, handleWebSockethandleRawWebSocket)

Changes reviewed:

  • Actor configuration schema updated correctly
  • Type definitions updated consistently
  • Error messages properly updated with new naming
  • Test cases updated with correct test descriptions
  • Comments in test utilities updated

Observations

  1. Naming Consistency: The new onRequest name is more generic and aligns better with standard HTTP terminology than onFetch which has specific connotations with the Fetch API.

  2. Method Renaming: The PR also renames internal methods to be more explicit:

    • handleFetchhandleRawRequest
    • handleWebSockethandleRawWebSocket

    This is good as it makes the "raw" nature of these handlers more explicit.

  3. Test Coverage: All test files have been updated with consistent naming, which is excellent for maintaining test quality.

  4. Error Code Changes: Error codes have been updated from fetch_not_defined to request_not_defined and invalid_fetch_response to invalid_request_handler_response. This is a breaking change for any external code that catches specific error codes.


Recommendations

  1. Fix the critical typo in RequestHandlerNotDfeined (should be RequestHandlerNotDefined)
  2. Consider documenting this as a breaking change if the error codes are part of a public API
  3. Verify that no external documentation or examples reference onFetch that weren't updated in this PR

Verdict

This is a clean, well-executed refactoring that improves naming consistency. The only blocker is the typo in the error class name that must be fixed before merging.

Once the typo is corrected, this PR will be ready to merge. ✨

@claude
Copy link

claude bot commented Nov 13, 2025

PR Review: Rename onFetch to onRequest

Overview

This PR performs a straightforward refactoring to rename the onFetch handler to onRequest across the RivetKit TypeScript codebase. The rename improves naming clarity since the handler processes all types of HTTP requests, not just fetch operations.

Code Quality ✅

  • Consistency: The rename is applied consistently across all affected files
  • Scope: Changes are appropriately limited to RivetKit TypeScript package
  • Documentation: Comments and test names updated to reflect the new naming

Critical Bug Found 🐛

Typo in Error Class Name (rivetkit-typescript/packages/rivetkit/src/actor/errors.ts:320)

export class RequestHandlerNotDfeined extends ActorError {

Should be:

export class RequestHandlerNotDefined extends ActorError {

Impact: This typo affects:

  • src/actor/errors.ts:320 - Class definition
  • src/actor/instance/mod.ts:652 - Usage in handleRawRequest method

This needs to be fixed before merging as it's a public-facing error class that users will encounter.

Method Renaming Review ✅

The following methods were correctly renamed:

  • onFetchonRequest (handler function)
  • handleFetchhandleRawRequest (internal method in ActorInstance)
  • handleWebSockethandleRawWebSocket (for consistency)
  • State fields: onFetchRequestonRequestRequest

Test Coverage ✅

Tests have been properly updated:

  • Test descriptions updated to use "onRequest" terminology
  • Test fixtures updated with new handler names
  • Comments in test code reflect the new naming
  • All existing test scenarios maintained

Performance Considerations ✅

No performance impact - this is purely a refactoring change with no algorithmic modifications.

Security Considerations ✅

No security implications - the functionality remains identical.

Recommendations

  1. Fix the typo in RequestHandlerNotDfeinedRequestHandlerNotDefined
  2. Consider running the full test suite to ensure no edge cases were missed
  3. Update any external documentation that references onFetch (if applicable)

Summary

This is a clean refactoring that improves API clarity. Once the typo is fixed, this PR will be ready to merge. The rename is well-executed with consistent updates across fixtures, tests, error messages, and documentation.

Verdict: Approve pending typo fix

@claude
Copy link

claude bot commented Nov 13, 2025

PR Review: Rename onFetch to onRequest

Overview

This PR renames the onFetch handler to onRequest throughout the RivetKit TypeScript codebase. This is a straightforward refactoring that improves naming clarity.

✅ Positives

  1. Consistent naming: The rename is applied systematically across all relevant files
  2. Clear intent: onRequest is more descriptive and aligns better with the handler's purpose of handling raw HTTP requests
  3. Complete coverage: The PR updates:
    • Core config and type definitions
    • Test fixtures and test cases
    • Error messages and class names
    • Comments and documentation strings
    • Internal method names (handleFetchhandleRawRequest)

🐛 Issues Found

Critical: Typo in Error Class Name

Location: rivetkit-typescript/packages/rivetkit/src/actor/errors.ts:320

export class RequestHandlerNotDfeined extends ActorError {

Issue: The class name has a typo: RequestHandlerNotDfeined should be RequestHandlerNotDefined (missing 'n' in "Defined")

Impact: This is a breaking change that will cause runtime errors if any code references this error class by name. The typo needs to be fixed before merging.

Recommendation: Rename to RequestHandlerNotDefined

📝 Minor Observations

  1. Incomplete comment update: In router.ts:198, there's a comment that says:

    // This should never happen now since handleFetch throws errors

    Should be updated to reference handleRawRequest instead of handleFetch.

  2. Consistent internal naming: Good choice to rename handleFetch to handleRawRequest and handleWebSocket to handleRawWebSocket - this maintains consistency in the internal API.

🎯 Code Quality

  • Naming convention: ✅ The new name onRequest is more semantic and better reflects the handler's purpose
  • Breaking change handling: ⚠️ This is a breaking API change - ensure proper versioning and migration documentation
  • Test coverage: ✅ All tests updated to reflect the new naming
  • Type safety: ✅ TypeScript types properly updated

🔒 Security

No security concerns identified - this is purely a naming refactor.

⚡ Performance

No performance impact - this is a compile-time change only.

✅ Action Items

Must fix before merge:

  • Fix typo: RequestHandlerNotDfeinedRequestHandlerNotDefined

Nice to have:

  • Update comment in router.ts:198 to reference handleRawRequest instead of handleFetch
  • Consider adding a deprecation notice or migration guide if this is a public API change

Summary

This is a solid refactoring PR that improves naming clarity. The main blocker is the typo in the error class name which must be fixed. Once corrected, this PR should be safe to merge.

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