Remix时未使用上游真实ID

Open Beginner friendly
#4,120 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
api, backend

Research direction

Start at the remix handling and task lookup around the referenced lines 47–65, then trace how the stored upstream task ID is exposed by the model. Verify that remix requests use that stored ID when calling the upstream service and that the existing task-not-found error path still applies when the original task is missing.

Written by the indexing model from the issue text.

Description

bug

提交前必读(请勿删除本节)

您当前的 newapi 版本

v0.12.2

提交确认

  • 我已确认目前没有类似 issue
  • 我已完整查看过文档 https://docs.newapi.ai/ 和项目 README,尤其是常见问题部分
  • 我未删除此模板中的任何引导内容或小节标题,并会按要求完整填写
  • 我理解项目维护者精力有限,不遵循模板要求的 issue 可能会被无视或直接关闭

问题描述
当用户提交视频延长(remix)请求时,NewAPI没有使用数据库存储的上游真实任务ID(UpstreamTaskID),而是直接将用户端传来的 task_id 转发给上游服务,导致上游服务返回"任务不存在"错误。

复现步骤

// 第47-51行:直接使用用户端传来的task_id
if info.Action == constant.TaskActionRemix {
    videoID := c.Param("video_id")
    info.OriginTaskID = videoID  // ← 问题:直接使用task_id
}

// 第59-65行:查询任务
originTask, exist, err := model.GetByTaskId(info.UserId, info.OriginTaskID)
// ← 查询后没有使用 originTask.GetUpstreamTaskID() 更新 info.OriginTaskID

预期结果

// 查询到原始任务后,应该使用上游真实ID
originTask, exist, err := model.GetByTaskId(info.UserId, info.OriginTaskID)
if !exist {
    return service.TaskErrorWrapperLocal(...)
}

// 添加这行:获取上游真实的任务ID
if info.Action == constant.TaskActionRemix {
    info.OriginTaskID = originTask.GetUpstreamTaskID()  // ← 关键修复
}

相关截图

Dominant language
Go
Stars
48.5k
Forks
11.6k
Avg merge
1d 9h
Merged PRs (30d)
61

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from QuantumNous/new-api

All issues in QuantumNous/new-api

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.