Pages: actions commit the `?actionName` URL to history
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript, vite
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by tracing makeCommit() and how visits set preserveState and commitTarget.fetchUrl; the issue identifies this history-writing logic as the cause. Compare the behavior with #506 and reproduce using useForm('/db?create', …) or action('/db?create', { data }) on /db. Done means a non-redirecting action keeps /db in the address bar and does not add a history entry for each submission.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When a named action finishes without redirecting, the router writes the action URL into the address bar with pushState. For example, submitting useForm('/db?create', …) on /db leaves the browser at /db?create. Each later submit adds another history entry.
Steps to reproduce
- Define named actions on a page:
// pages/db.server.ts export const actions = { create: defineHandler.withValidator({ body: schema })(async (_c, { body }) => { await createNote(body); }), }; - On
/db, submituseForm('/db?create', …), or callaction('/db?create', { data }). - Check
location.hrefandhistory.length.
Actual behavior
- The address bar shows
/db?create, or/db?deleteafter another action. history.lengthgoes up by one on every submit, so Back steps through each submission before leaving the page.
Expected behavior
An action that re-renders the current page should keep the page's URL (/db). It should either leave the history alone or replace the current entry. The docs describe a void return as "re-runs the loader, page re-renders with fresh props", which suggests staying on the page.
Cause
makeCommit() writes commitTarget.fetchUrl to history for every visit that doesn't set preserveState, including non-GET visits. useForm and action() don't expose preserveState or replace, so callers can't opt out. Returning c.redirect('/db') avoids the wrong URL, but it adds a round trip and still pushes an entry.
Related
#506 changes the same history-writing logic in makeCommit().
Environment
- void 1.1.12
- @void/react 1.1.12
- Ngôn ngữ chính
- TypeScript
- Star
- 402
- Fork
- 32
- Merge trung bình
- 10 giờ 51 phút
- Pull request đã merge (30 ngày)
- 100
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của voidzero-dev/void
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
voidzero-dev/void#529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
voidzero-dev/void#428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
voidzero-dev/void#525 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
voidzero-dev/void#524 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 52/100
voidzero-dev/void#523 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của voidzero-dev/void
Issue tương tự
-
agent/scanner help wanted hive/claimed-by-scanner kind/bug stage/020-claimed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
hivecommons/rationguard#315 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-ready area: ui-sdk priority: p3 type: chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
schlessera/brain-kit#2534 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug lane:gh-5
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
LLM-4-People/bridlewise-testing#122 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement priority:low ready-for-dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày