Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Serverless listener forwards /start to the application when basePath is "/"

Aperta Adatta ai principianti
#5,755 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Saisharathchandranandnetha ci sta già lavorando.

Dal 19/9/2026.

  • #5756 di @Saisharathchandranandnetha — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Inizia in rivetkit-rust/packages/rivetkit-core/src/serverless.rs, in handles_listener_request, quindi esamina route_path e i test serverless correlati. Esegui il cargo test indicato con la riproduzione del percorso di base root; è completato quando /, /start, /health, /metadata e /metrics sono riservati, mentre /application viene inoltrato all'applicazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

With serverless.basePath: "/" and an application passed to registry.listen(), the Rust listener forwards the engine's POST /start to the application instead of handling it. Same for /health, /metadata and /metrics. Actors on that pool never start. The same config works through registry.handler().

Where

handles_listener_request in rivetkit-rust/packages/rivetkit-core/src/serverless.rs:

let request_path = parsed.path();
if request_path != base_path && !request_path.starts_with(&format!("{base_path}/")) {
	return false;
}

Why it happens

normalize_base_path(Some("/")) returns "/", so the prefix check looks for "//". No request path starts with //, so everything except / itself returns false. serverless_http.rs only hands a request to the runtime when this returns true or when there's no application, so /start ends up in the user's handler.

route_path already handles a root base path correctly. It's only this check. The TypeScript side special-cases it in isServerlessStartRequest (basePath === "/" ? "" : ...), which is why registry.handler() works.

Reproduction

Add to rivetkit-rust/packages/rivetkit-core/tests/serverless.rs:

#[test]
fn listener_reserves_framework_routes_for_root_base_path() {
	let base_path = normalize_base_path(Some("/"));
	for path in ["/", "/start", "/health", "/metadata", "/metrics"] {
		assert!(
			handles_listener_request(&base_path, &format!("http://internal{path}")),
			"root base path should reserve {path}"
		);
	}
	assert!(!handles_listener_request(&base_path, "http://internal/application"));
}

cargo test -p rivetkit-core --lib listener_reserves_framework_routes_for_root_base_path fails with root base path should reserve /start.

Expected behaviour

With a root base path the listener handles /, /start, /health, /metadata and /metrics itself and forwards everything else to the application.

Suggested fix

Treat base_path == "/" as matching every request path before the prefix check. route_path already returns the right route in that case. Happy to open a PR.

Environment

  • upstream/main at 78336a1a0
  • Linux 7.2.5-3-omarchy
  • rustc 1.98.1 (48a229cea 2026-09-01), cargo 1.98.1 (797e8a9bc 2026-08-05)
Lingua principale
Rust
Stelle
6.3k
Fork
271
Merge medio
2g 16h
PR unite (30g)
89

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rivet-dev/rivet

Tutte le issue di rivet-dev/rivet

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.