Skip to content

fix(api): properly dedup name list responses#4337

Open
MasterPtato wants to merge 1 commit intofix-ups-formalize-subjectsfrom
fix-api-properly-dedup-name-list
Open

fix(api): properly dedup name list responses#4337
MasterPtato wants to merge 1 commit intofix-ups-formalize-subjectsfrom
fix-api-properly-dedup-name-list

Conversation

@MasterPtato
Copy link
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@MasterPtato
Copy link
Contributor Author

MasterPtato commented Mar 3, 2026

@railway-app
Copy link

railway-app bot commented Mar 3, 2026

🚅 Deployed to the rivet-pr-4337 environment in rivet-frontend

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web Mar 5, 2026 at 3:31 am
frontend-inspector 😴 Sleeping (View Logs) Web Mar 4, 2026 at 10:14 pm
frontend-cloud ❌ Build Failed (View Logs) Web Mar 3, 2026 at 12:10 am
mcp-hub ✅ Success (View Logs) Web Mar 3, 2026 at 12:09 am
ladle ❌ Build Failed (View Logs) Web Mar 3, 2026 at 12:07 am

@claude
Copy link

claude bot commented Mar 3, 2026

PR Review: fix(api): properly dedup name list responses

The core idea is right -- using IndexMap/IndexSet as the fanout accumulator to deduplicate names naturally is cleaner than the previous Vec-based approach. However, there are two bugs introduced.

Bug 1: Limit applied before sort in list_names.rs and runners.rs

In both files, .take(limit) runs on the unsorted fanout result before sort_keys()/sort(). IndexMap/IndexSet preserves insertion order (non-deterministic across fanout responses), so the limit is applied to an arbitrary subset. The page is sorted within itself, but may not be the right first-N alphabetical entries.

The fix: collect all (dedup via IndexMap/IndexSet) -> sort -> truncate. Both types support truncate() in-place, so the sort-then-truncate idiom used in the old Vec code should be preserved:

For list_names.rs: sort_keys() then truncate(query.limit.unwrap_or(100))
For runners.rs: sort() then truncate(limit)

Bug 2: Cursor filtering removed in list.rs (actor_ids path)

The PR removes cursor-based pagination filtering for the actor_ids path with no apparent replacement. Unless fetch_actors_by_ids now handles cursor filtering internally when given Some(limit), the cursor query param is silently ignored for this path and pagination always returns the same first page. This also appears unrelated to the dedup fix -- was this intentional?

Minor: Redundant truncation in list.rs

After passing Some(limit) to fetch_actors_by_ids, actors.truncate(limit) is a no-op if the fetch already respects the limit.

Summary

  • list_names.rs: Limit before sort, wrong page returned (Bug)
  • runners.rs: Limit before sort, wrong page returned (Bug)
  • list.rs: Cursor filtering removed for actor_ids path (Possible bug / needs clarification)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 3, 2026

More templates

@rivetkit/cloudflare-workers

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

@rivetkit/framework-base

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

@rivetkit/next-js

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

@rivetkit/react

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

rivetkit

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

@rivetkit/sql-loader

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

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4337

@rivetkit/traces

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

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4337

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4337

@rivetkit/engine-runner

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

@rivetkit/engine-runner-protocol

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

commit: f51f17a

@MasterPtato MasterPtato force-pushed the fix-ups-formalize-subjects branch from c8e5674 to 73da062 Compare March 6, 2026 02:17
@MasterPtato MasterPtato force-pushed the fix-api-properly-dedup-name-list branch from c571c59 to 5950673 Compare March 6, 2026 21:09
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