Skip to content

Conversation

MasterPtato
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 15, 2025

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

Project Deployment Preview Comments Updated (UTC)
rivet-cloud Error Error Sep 16, 2025 1:08am
rivet-site Ready Ready Preview Comment Sep 16, 2025 1:08am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rivet-studio Ignored Ignored Preview Sep 16, 2025 1:08am

Copy link

claude bot commented Sep 15, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@MasterPtato MasterPtato mentioned this pull request Sep 15, 2025
Copy link
Contributor Author

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.

Copy link

pkg-pr-new bot commented Sep 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/rivet-gg/engine/@rivetkit/engine-runner@2922
npm i https://pkg.pr.new/rivet-gg/engine/@rivetkit/engine-runner-protocol@2922
npm i https://pkg.pr.new/rivet-gg/engine/@rivetkit/engine-tunnel-protocol@2922

commit: e92e865

@MasterPtato MasterPtato force-pushed the 09-15-chore_clean_up_api-public branch from bb798a4 to e92e865 Compare September 16, 2025 01:04
Copy link

claude bot commented Sep 16, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Comment on lines +36 to +63
pub async fn list(ctx: ApiCtx, path: ListPath, query: ListQuery) -> Result<ListResponse> {
let namespace = ctx
.op(namespace::ops::resolve_for_name_global::Input {
name: query.namespace.clone(),
})
.await?
.ok_or_else(|| namespace::errors::Namespace::NotFound.build())?;

if query.runner_name.is_empty() {
let runner_configs = ctx
.op(namespace::ops::runner_config::get_local::Input {
runners: query
.runner_name
.iter()
.map(|name| (namespace.namespace_id, name.clone()))
.collect(),
})
.await?;

Ok(ListResponse {
// TODO: Implement ComposeSchema for FakeMap so we don't have to reallocate
runner_configs: runner_configs
.into_iter()
.map(|c| (c.name, c.config))
.collect(),
pagination: Pagination { cursor: None },
})
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be a logic error in the conditional. The code checks if query.runner_name.is_empty() but then proceeds to use query.runner_name inside that block to fetch specific runner configs. This logic should be inverted - if query.runner_name is NOT empty, then get those specific configs, otherwise list all configs with pagination.

The current implementation will attempt to map over an empty collection when the condition is true, which won't produce the expected results.

Suggested change
pub async fn list(ctx: ApiCtx, path: ListPath, query: ListQuery) -> Result<ListResponse> {
let namespace = ctx
.op(namespace::ops::resolve_for_name_global::Input {
name: query.namespace.clone(),
})
.await?
.ok_or_else(|| namespace::errors::Namespace::NotFound.build())?;
if query.runner_name.is_empty() {
let runner_configs = ctx
.op(namespace::ops::runner_config::get_local::Input {
runners: query
.runner_name
.iter()
.map(|name| (namespace.namespace_id, name.clone()))
.collect(),
})
.await?;
Ok(ListResponse {
// TODO: Implement ComposeSchema for FakeMap so we don't have to reallocate
runner_configs: runner_configs
.into_iter()
.map(|c| (c.name, c.config))
.collect(),
pagination: Pagination { cursor: None },
})
} else {
pub async fn list(ctx: ApiCtx, path: ListPath, query: ListQuery) -> Result<ListResponse> {
let namespace = ctx
.op(namespace::ops::resolve_for_name_global::Input {
name: query.namespace.clone(),
})
.await?
.ok_or_else(|| namespace::errors::Namespace::NotFound.build())?;
if !query.runner_name.is_empty() {
let runner_configs = ctx
.op(namespace::ops::runner_config::get_local::Input {
runners: query
.runner_name
.iter()
.map(|name| (namespace.namespace_id, name.clone()))
.collect(),
})
.await?;
Ok(ListResponse {
// TODO: Implement ComposeSchema for FakeMap so we don't have to reallocate
runner_configs: runner_configs
.into_iter()
.map(|c| (c.name, c.config))
.collect(),
pagination: Pagination { cursor: None },
})
} else {

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@NathanFlurry
Copy link
Member

@MasterPtato i'll let you figure out how to resolve these conflicts, very confused here

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.

3 participants