Skip to content

fix(download): link completed downloads by resource ID - #559

Merged
Alruinous merged 1 commit into
raids-lab:mainfrom
Jinghao-coding:codex/fix-download-resource-link
Nov 5, 2026
Merged

Alruinous merged 1 commit into
raids-lab:mainfrom
Jinghao-coding:codex/fix-download-resource-link

Conversation

@Jinghao-coding

Copy link
Copy Markdown
Member

Fix completed model/dataset downloads opening a different resource with the same name.

Changes

  • Resolve an optional resourceId in download details using the stored download path and resource type, matching resource publication. Existing and renamed resources work without a database migration; missing/deleted resources produce no link.
  • Navigate directly by the returned ID and remove the frontend's full resource-list request and name-based lookup.
  • Update Swagger and add regression coverage for both resource types, same-name decoys, different types/paths, historical paths, renaming, deletion, and the detail response.

Testing

AI:

  • Backend make fmt pre-commit-check build and go vet ./internal/handler: passed.
  • Handler tests: 97 tests/subtests passed. A temporary Go overlay supplied SQLite only for package-initialization bootstrap; regression fixtures used isolated SQLite databases. The resource regressions also passed with a different physical public-storage prefix.
  • Frontend make pre-commit-check build: passed.
  • Playwright with the actual detail component and controlled fixtures: the baseline opened same-name resource 11; the fix opened resource 42 for models and datasets. Both categories hid the button when resourceId was absent, even with same-name resources cached.
  • git diff --check: passed.

Compatibility and deployment

resourceId is optional and used by the frontend; CLI download decoding, commands, and output are unchanged. Backend/CLI APIVersion remain 4; backend MinSupportedCLIAPIVersion and CLI MinSupportedBackendAPIVersion each remain 3. Chart configuration and version/appVersion remain unchanged at 1.5.0. Deploy the backend before the frontend so the ID is available immediately.


修复模型、数据集下载完成后,资源卡片可能跳转到另一条同名资源的问题。

修改

  • 下载详情按实际存储路径和资源类型查询并返回可选的 resourceId,与资源发布时的标识规则一致。兼容已有记录和资源重命名,无需数据库迁移;资源不存在或已删除时不返回跳转目标。
  • 前端直接按返回的 ID 跳转,移除获取整个资源列表及按名称匹配的逻辑。
  • 同步 Swagger,补充模型/数据集、同名干扰项、不同类型与路径、历史路径、重命名、删除及详情响应的回归测试。

测试

AI:

  • 后端 make fmt pre-commit-check build、go vet ./internal/handler:通过。
  • Handler 测试包共 97 个测试及子测试通过。临时 Go overlay 仅将包初始化的数据库引导替换为 SQLite;回归用例使用独立 SQLite 数据库。资源回归在非默认物理公共存储前缀下也通过。
  • 前端 make pre-commit-check build:通过。
  • Playwright 使用实际详情组件与受控测试数据:主线组件跳到同名资源 11,修复后模型、数据集均跳到指定资源 42;未返回 resourceId 时,两类页面均隐藏按钮,即使缓存中仍有同名资源。
  • git diff --check:通过。

兼容性与部署

resourceId 为前端使用的可选字段,CLI 下载接口解码、命令及输出保持不变。后端、CLI 的 APIVersion 均保持 4;后端 MinSupportedCLIAPIVersion、CLI MinSupportedBackendAPIVersion 均保持 3。Chart 配置及 version/appVersion 保持 1.5.0。先部署后端,再部署前端,使跳转 ID 立即可用。

Closes #558

Resolve the destination from storage path and resource type so same-name
resources cannot redirect download details to another card.

Closes raids-lab#558

Signed-off-by: Jinghao-coding <jeffery_06@163.com>
@Jinghao-coding
Jinghao-coding marked this pull request as ready for review November 3, 2026 15:58
Copilot AI balanced review requested due to automatic review settings November 3, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T16:03:06.720101Z 3571dd1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Alruinous
Alruinous merged commit 62b1a58 into raids-lab:main Nov 5, 2026
4 checks passed
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.

fix(download): completed downloads can open the wrong same-name resource

3 participants