[PATCH v2] ui: disambiguate local patchset links
Longlong Xia <[email protected]> Wed, 22 Jul 2026 11:31:35 +0800
| Newsgroups | dev.linux.lists.sashiko |
|---|---|
| Message-ID | <[email protected]> |
From: Longlong Xia <[email protected]> Repeated local Git submissions use the same synthetic cover Message-ID when they target the same revision range. Because the patchset list uses that value before the database ID, each row opens the first matching patchset and can display stale review results. Use the unique patchset ID for synthetic local Message-IDs and commit SHAs. Keep slugs as the preferred route for forge submissions and retain stable Message-ID links for mailing-list submissions. Fixes: d46ec40c1a66 ("feat(api): support Message-ID based lookups for patchsets and messages") Signed-off-by: Longlong Xia <[email protected]> Changes in v2: - Use numeric IDs only for synthetic local Message-IDs and commit SHAs. - Preserve stable Message-ID links for mailing-list submissions. - Drop the source-level regression test. A broader database-level fix is proposed in https://github.com/sashiko-dev/sashiko/pull/211; this patch is limited to the UI ambiguity on current main. --- static/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 9f424c7..4f50e7f 100644 --- a/static/index.html +++ b/static/index.html @@ -1964,7 +1964,12 @@ const clickHandler = (e) => { if (e.target.closest('.copy-btn')) return; - const target = `#/patchset/${encodeURIComponent(p.slug || p.message_id || p.id)}`; + const isLocalGitSubmission = p.message_id && + (/^[0-9a-f]{40}$/.test(p.message_id) || + p.message_id.includes('@sashiko.local')); + const routeId = p.slug || + (isLocalGitSubmission ? p.id : p.message_id) || p.id; + const target = `#/patchset/${encodeURIComponent(routeId)}`; if (e.button === 1 || e.ctrlKey || e.metaKey) { window.open(target, '_blank'); } else if (e.button === 0) { -- 2.43.0