Pages: preserveState prevents the destination URL from being committed
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript, vite
- Área
- backend-api-design, frontend
Línea de trabajo
Start in packages/void/src/pages/navigation-engine.ts, especially makeCommit() and its history-writing condition, then trace how normal visits, router.refresh(), and back/forward navigation select commit behavior. Run the reported unit tests with vp test run and locate the shared-router regression tests. Done means preserveState visits update the URL, replace still replaces, refresh and history navigation add no entries, and tests cover state preservation and URL behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Calling router.visit('/settings', { preserveState: true }) updates the rendered page, but leaves the browser URL pointing to the previous page.
This appears to couple component state preservation with history updates.
Environment
- Commit:
2ceab89154dc6e0c3fa5525f7bd4d1d5f3d0aa64 - Package version in the repository:
1.1.12 - Chromium Headless Shell:
134.0.6998.35 - Playwright:
1.64.1
Steps to reproduce
- Start on
/case. - Navigate using:
await router.visit('/settings', {
preserveState: true,
});
- Return a valid Pages response for
/settings. - Compare the rendered page with
window.location.pathname.
Actual behavior
The destination page renders, but the address bar remains on /case.
In an isolated browser fixture using the production createVoidRouter():
| Value | Result |
|---|---|
| Rendered page | /settings |
window.location.pathname |
/case |
router.path after the visit |
/case |
This reproduced in all three browser runs. A direct regression test against the shared router also fails because history.pushState() is not called.
The unit tests were run with vp test run. The browser fixture was run separately through a Node.js script using Playwright; it was not run as an existing Void browser integration suite. The fixture exercises the actual client runtime with a small HTTP server; this was not a full production-build test across every adapter.
Expected behavior
The rendered page and browser URL should both reflect /settings.
preserveState should control component state preservation independently of whether a normal visit writes history. replace should continue to select between replacing and adding an entry.
Relevant implementation
In makeCommit(), history updates are skipped whenever preserveState is true:
if (!options.preserveState) {
const historyUrl = commitTarget.fetchUrl + commitTarget.hash;
scrollRestoration.writeHistory(historyUrl, !!options.replace);
}
Separating history-writing decisions from state preservation would also need to retain the existing behavior of router.refresh() and back/forward navigation, which should not add history entries.
Acceptance criteria
- A normal visit with
preserveState: trueupdates the destination URL. replace: truereplaces the current entry.router.refresh()and back/forward navigation do not add entries.- Regression coverage checks both state preservation and URL/history behavior.
- Lenguaje dominante
- TypeScript
- Estrellas
- 402
- Forks
- 32
- Merge medio
- 11 h 52 min
- PR fusionados (30 d)
- 88
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de voidzero-dev/void
-
bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
voidzero-dev/void#428 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
voidzero-dev/void#511 ·
Los mantenedores suelen responder en 1 día
-
Platform email: outbound-only custom domain for an apex whose MX belongs to another providerAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
voidzero-dev/void#510 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 58/100
voidzero-dev/void#509 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
voidzero-dev/void#507 ·
Los mantenedores suelen responder en 1 día
Todos los issues de voidzero-dev/void
Issues similares
-
engine-rs P3 review-deferral wasm
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
maniator/verticopolis#1154 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
telerik/kendo-react#3861 ·
Los mantenedores suelen responder en 1 día
-
[bug]: use-mobile.ts uses pixel logic, causing UI state de-sync with Tailwind CSS rem breakpointsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
task
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100