Skip to content

Conversation

jog1t
Copy link
Contributor

@jog1t jog1t commented Oct 7, 2025

TL;DR

Fixed query key indexing in actor queries context and added default timestamp-based hash generation.

What changed?

  • Fixed the queryFn implementations to correctly access the actorId from the query key array at index 2 instead of index 1
  • Added a default value for the hash parameter that uses the current timestamp (Date.now()) when no hash is provided

How to test?

  1. Verify that actor queries work correctly by navigating to the actor inspector in the UI
  2. Test with both explicit hash values and without providing a hash to ensure the default timestamp-based hash works properly
  3. Confirm that all actor-related queries (ping, state, connections, database, events, RPCs, auto-wake-up) function as expected

Why make this change?

The previous implementation had incorrect indexing when accessing query key elements, which could lead to undefined values and errors. The query key structure is [hash, "actor", actorId, ...], so the actorId is at index 2, not index 1. Additionally, providing a default timestamp-based hash ensures that the context always has a unique identifier even when not explicitly provided.

Copy link

vercel bot commented Oct 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
rivet-cloud Canceled Canceled Oct 7, 2025 10:05pm
rivet-inspector Canceled Canceled Oct 7, 2025 10:05pm
rivet-site Canceled Canceled Oct 7, 2025 10:05pm

Copy link

claude bot commented Oct 7, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link
Contributor Author

jog1t commented Oct 7, 2025


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.

@jog1t jog1t marked this pull request as ready for review October 7, 2025 22:03
Copy link

pkg-pr-new bot commented Oct 7, 2025

Open in StackBlitz

npm i https://pkg.pr.new/rivet-dev/engine/@rivetkit/engine-runner@3104
npm i https://pkg.pr.new/rivet-dev/engine/@rivetkit/engine-runner-protocol@3104

commit: c9c24ce

Copy link
Contributor

graphite-app bot commented Oct 7, 2025

Merge activity

  • Oct 7, 10:03 PM UTC: jog1t added this pull request to the Graphite merge queue.
  • Oct 7, 10:04 PM UTC: CI is running for this pull request on a draft pull request (#3105) due to your merge queue CI optimization settings.
  • Oct 7, 10:05 PM UTC: Merged by the Graphite merge queue via draft PR: #3105.

graphite-app bot pushed a commit that referenced this pull request Oct 7, 2025
### TL;DR

Fixed query key indexing in actor queries context and added default timestamp-based hash generation.

### What changed?

- Fixed the `queryFn` implementations to correctly access the `actorId` from the query key array at index 2 instead of index 1
- Added a default value for the `hash` parameter that uses the current timestamp (`Date.now()`) when no hash is provided

### How to test?

1. Verify that actor queries work correctly by navigating to the actor inspector in the UI
2. Test with both explicit hash values and without providing a hash to ensure the default timestamp-based hash works properly
3. Confirm that all actor-related queries (ping, state, connections, database, events, RPCs, auto-wake-up) function as expected

### Why make this change?

The previous implementation had incorrect indexing when accessing query key elements, which could lead to undefined values and errors. The query key structure is `[hash, "actor", actorId, ...]`, so the `actorId` is at index 2, not index 1. Additionally, providing a default timestamp-based hash ensures that the context always has a unique identifier even when not explicitly provided.
@vercel vercel bot temporarily deployed to Preview – rivet-cloud October 7, 2025 22:04 Inactive
@vercel vercel bot temporarily deployed to Preview – rivet-site October 7, 2025 22:05 Inactive
@vercel vercel bot temporarily deployed to Preview – rivet-inspector October 7, 2025 22:05 Inactive
Copy link
Contributor

graphite-app bot commented Oct 7, 2025

Graphite Automations

"Test" took an action on this PR • (10/07/25)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

@graphite-app graphite-app bot closed this Oct 7, 2025
@graphite-app graphite-app bot deleted the 10-08-fix_inspector branch October 7, 2025 22:05
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