Skip to content

fix(framework-base): params not being passed to actor handle#1133

Closed
NathanFlurry wants to merge 1 commit intomainfrom
07-27-fix_framework-base_params_not_being_passed_to_actor_handle
Closed

fix(framework-base): params not being passed to actor handle#1133
NathanFlurry wants to merge 1 commit intomainfrom
07-27-fix_framework-base_params_not_being_passed_to_actor_handle

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

No description provided.

@claude
Copy link
Copy Markdown

claude bot commented Jul 28, 2025

Claude finished @NathanFlurry's task —— View job


Code Review Complete ✅

Todo List:

  • Read and analyze the changed file
  • Review code quality and best practices
  • Check for potential bugs or issues
  • Assess performance considerations
  • Review security concerns
  • Evaluate test coverage needs
  • Provide comprehensive feedback

Review Summary

This is a critical bug fix that correctly addresses params not being passed to actor handles in the framework-base package.

Code Quality & Best Practices

The Fix Is Correct:

  • Line 176: Changed from actor.opts.params to { params: actor.opts.params }
  • Correctly wraps params in the expected GetOrCreateOptions object structure
  • Aligns with the client.getOrCreate() method signature which expects options as the third parameter
  • Follows established patterns used throughout the codebase and test suite

Code Quality:

  • Clean, minimal change that addresses the root cause
  • Maintains existing code style and structure
  • Proper TypeScript usage

Bug Analysis

Root Cause: The client.getOrCreate() method expects:

getOrCreate(name, key, { params: actualParams })  // ✅ Correct

But was receiving:

getOrCreate(name, key, actualParams)  // ❌ Wrong

Impact: This bug prevented actor parameters from being passed correctly from React components using useActor({ params: ... }) to the underlying actor instances, breaking parameter-dependent actor functionality.

Performance Considerations

  • Minimal overhead: Only adds object wrapping, no computational impact
  • No performance regression: The fix restores intended functionality without performance costs
  • Memory impact: Negligible - creates one additional object per actor creation

Security Concerns

  • No security issues identified - this is a parameter passing fix
  • No data exposure risks - maintains same data flow, just fixes the structure
  • Input validation: Params are still subject to the same validation as before

⚠️ Test Coverage Concerns

Critical Gap Identified:

  • No dedicated tests for the framework-base package
  • Missing integration tests that verify params flow from framework layer to actors
  • No regression test for this specific bug

Existing Coverage:

  • Core-level params passing is well tested in packages/core/src/driver-test-suite/tests/actor-conn.ts
  • However, framework abstraction layer lacks test coverage

📋 Recommendations

  1. Add Integration Tests (High Priority):

    // Suggested test structure
    test('framework should pass params to actor handle', async () => {
      const { result } = renderHook(() => 
        useActor({ name: 'testActor', key: 'test', params: { foo: 'bar' } })
      );
      // Verify params reach actor's createConnState
    });
  2. Create Regression Test to prevent this specific bug from reoccurring

  3. Consider adding framework-level test suite similar to the existing driver test suite

🎯 Conclusion

APPROVE - This is a well-executed bug fix that:

  • ✅ Correctly addresses the stated problem
  • ✅ Follows established patterns and conventions
  • ✅ Has minimal risk and clear benefit
  • ✅ Maintains code quality standards

Priority: This fix should be merged as it resolves a critical functionality bug affecting actor parameter passing.

Follow-up: Consider adding comprehensive test coverage for the framework-base package to prevent similar regressions.


Copy link
Copy Markdown
Member Author

NathanFlurry commented Jul 28, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jul 28, 2025

Open in StackBlitz

@rivetkit/actor

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/actor@1133

@rivetkit/core

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/core@1133

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/db@1133

rivetkit

pnpm add https://pkg.pr.new/rivet-gg/rivetkit@1133

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/cloudflare-workers@1133

@rivetkit/redis

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/redis@1133

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/framework-base@1133

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/react@1133

commit: 1c0c4e9

@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Jul 28, 2025

Merge activity

  • Jul 28, 2:02 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Jul 28, 2:03 AM UTC: NathanFlurry removed this pull request from the Graphite merge queue.
  • Jul 28, 2:03 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Jul 28, 2:05 AM UTC: CI is running for this pull request on a draft pull request (#1139) due to your merge queue CI optimization settings.
  • Jul 28, 2:06 AM UTC: Merged by the Graphite merge queue via draft PR: #1139.

@graphite-app graphite-app bot closed this Jul 28, 2025
@graphite-app graphite-app bot deleted the 07-27-fix_framework-base_params_not_being_passed_to_actor_handle branch July 28, 2025 02:06
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.

1 participant